c# - Using paging (Skip, Take) over multiple DbSets -
i have entity framework dbcontext 2 different dbsets.
in view combining these 2 sets same view model , listing them in same table.
i want support table paging able query page of records @ time sorted particular column. can't see how without reading of records database , paging memory.
for example, want able sort date ascending since both tables have date column. take page size both tables , sort in memory problem comes play when skipping records. not know how many skip in each table since depends on how many records found in other table.
is there way manipulate entity framework this?
it possible.
- join them in database (can done in ef).
- project (select new {}) final object
- order by, skip, take on projection.
it crap performance wise there no way around given have broken database model. has tempoary view of rows sql find first ones - slow.
Comments
Post a Comment