I'm looking at this example given by Microsoft and I completely get the point of what they're trying to do: http://ift.tt/1u56pfd
My question is: how do you implement this efficiently when doing paging or dealing with huge datasets (millions or more records)? The way I read this code, it ToLists the entire data set every time you call GetStudents from the repo. How do you efficiently implement search, sorting, and paging with a repository (I'm defining efficiently as in the app doesn't have to query ALL rows to do a filter/paging/sorting operation)? In my particular case I'm talking about Entity Framework. I have used IQueryable for efficient queries in the past, but I don't see a way to generate efficient store queries with the repository pattern. Please help!
Aucun commentaire:
Enregistrer un commentaire