I have a method, that returns a group of accounts
Public Shared Function GetAllNotesByUser(ByVal UserID As Guid) As Account (??)
Using db As New MyEntity
Dim query= (From A In db.Account _
Where A.aspnet_Users.UserId = UserID _
Select A)
Return query
End Using
End Function
I would then like to pass this to another function to calculate the totals for all the accounts in the collection. Is it best practice to return an Ienumerable, a generic list, I’m just not sure what works best with LINQ and the entity framework.
When propagating LINQ query results from methods in this manner, the best choice for the return type is
IEnumerable(Of T)for LINQ to objects orIQueryable(Of T)for other LINQ providers. In this case it looks likeAccountis the type soIEnumerable(Of Account)orIQueryable(Of T)depending on the query type in question.