In Onion Architecture, we have repository layer which conducts Crud Operations (simple insert, delete, update). (Applying Entity Framework with database)
Additionally , we have Service Layer which conducts complex business logic.
(1) Should DBContext leak into Service layer? What if we wanted to conduct a complex business logic query, which is not possible from simple repository, and then EF Savechanges in database?
(2) Should IQueryable be in Service layer? Again, what if there is a need for a complex query that is best by creating and then running expression tree in the service layer after its built?