I am trying to do pagination by using asp.net mvc core 1.2 .
I followed the below link
"https://www.reflectionit.nl/blog/2017/paging-in-asp-net-core-mvc-and-entityframework-core"
IQueryable<searchdata> qry = objReturnDoc.GetViewLogger(search).AsQueryable();
var result = await PagingList<searchdata>.CreateAsync(qry,3,1,null,null);
The above line throwing following error
An unhandled exception occurred while processing the request.
InvalidOperationException: The provider for the source IQueryable doesn't implement IAsyncQueryProvider. Only providers that implement IEntityQueryProvider can be used for Entity Framework asynchronous operations.
I agree , am not using Entity framework. am using list..How to to fix it? Thanks in advance
What I have tried:
public async Task<iactionresult> ViewLog(string claimNum,string ReqId,string startDate,string endDate,int page)
{
SearchData search = new SearchData();
search.claimNum = claimNum;
if (startDate != null)
search.StartDate = startDate;
if (endDate != null)
search.EndDate = endDate;
search.claimNum = "8848948488";
search.rqID = ReqId;
ReturnDocRepository objReturnDoc = new ReturnDocRepository("mongodb://10.66.60.192:27017");
IQueryable<searchdata> qry = objReturnDoc.GetViewLogger(search).AsQueryable().
// am Getting error on below line
var result = await PagingList<searchdata>.CreateAsync(qry,3,1,null,null);
InvalidOperationException: The provider for the source IQueryable doesn't implement IAsyncQueryProvider. Only providers that implement IEntityQueryProvider can be used for Entity Framework asynchronous operations.
return View(result);
}