mardi 22 décembre 2015

Code organization in mvc

In our web application we have repositories with CRUD operations and a generic finder function, for instance userRepository.Get(u => u.Username == someString). And UserRepository will return only User objects.

But what if I have a complex query which do the join between Table1, Table2 and Table3 and returns CustomObject which contains some properties from these 3 tables.

Should I put those queries in a Service layer? Should repositories only contain basic CRUD and finder function and return basic entity object and nothing else? I ask because some people told me that no queries should be in Service layer...

Aucun commentaire:

Enregistrer un commentaire