Hello,
We have started developing the application services for our product and we are struggling to find the most appropiate way of querying data from a large entity graph.
3 Answer(s)
-
0
hi, you can create a DomainService for common queries and different application services can consume from this domain service.
-
0
Hello,
I understand that, but I would have performance issues doing it that way because I have to join though many entities and domain services should not use repositories according to DDD guidelines.
Maybe I should implement custom repositories when I need to do complex queries with multiple joins?
-
0
If you are worried about performance, then you need to ignore some best practices.
Raw SQL (T-SQL) or a stored procedure always perform better than an ORM solution because you don't have to marshal the data over the wire to the ORM to perform updates.
So my recommendation is; When you a heavy query create a custom repository and use raw SQL ...