我对pagedlist有个问题。
我想要更改选定的列,但不工作。所以我想这样做:
return db.stock_products.select(x=> new {x.id,x.title,x.etc}).AsExpandable().Where(classFilter).OrderByDescending(x => x.id).ToPagedList(pageNumber, pageSize);代码:
public async Task<IPagedList<DAL.stock_products>> GetPagedListAsync(int pageNumber = 1, int pageSize = 23)
{
try
{
return await Task.Factory.StartNew(() =>
{
if (isFiltered == false)
{
return db.stock_products.Where(x=>x.quantity>0).OrderByDescending(x => x.id).ToPagedList(pageNumber, pageSize);
}
isFiltered = false;
return db.stock_products.AsExpandable().Where(classFilter).OrderByDescending(x => x.id).ToPagedList(pageNumber, pageSize);
});
}
catch (Exception ex)
{
MessageBox.Show("Stop", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand);
Application.Exit();
}
return null;
}https://stackoverflow.com/questions/41328272
复制相似问题