Reputation: 3240
As in questions, I need to merge results from both repositories and I can't do it by SQL.
Is this correct way or maybe I should create service class to handle repositories logic?
Upvotes: 0
Views: 118
Reputation: 25315
No, it's not good practice. Use a service object to handle any complex operations between two or more result sets from multiple entity repositories. Your repositories should still contain the queries, but a service object should be responsible for merging or filtering them into one final result set.
Upvotes: 2