问题
I have to execute a sql string in .net core so first I added a Dbquery type entity in dbcontext.
internal DbQuery<TempData> MyDataList{ get; set; }
Then I fetched the data with my sql string as
var data = context.MyDataList.FromSql(dataqueryString).ToList();
Iam getting the data correct but need to implement PagedList on this without fetching the whole data from database.
I have tried like
var data = context.MyDataList.FromSql(dataqueryString).ToPagedList(1,10)
But this will fetch whole data from database first then implement pagination. Is there any way to do this in a proper way?
来源:https://stackoverflow.com/questions/66020780/how-to-implement-pagedlist-on-dbquery-entity-in-dbcontext-without-fetching-full