What I mean by that is, say I have a method in my repository:
Public Function GetCustomerByState(ByVal State As String) As IQueryable(Of Customer)
Should the service be able to get additional data in the form of say this extension to say get the orders for the customer:
<Extension()> _
Public Function Include(Of T)(ByVal Source As IQueryable(Of T), ByVal Path As String) As IQueryable(Of T)
Dim ObjectQuery = CType(Source, ObjectQuery(Of T))
If (ObjectQuery IsNot Nothing) Then
Return ObjectQuery.Include(Path)
End If
Return Source
End Function
This extension is most likely used with a generic repository.
Or should you have concrete implementations of the repositories per aggregate root that return to the service exactly what it needs and nothing more or less?
Then, should your repositories even return IQueryable?