类库
{
public List<lqjModel> list { get; set; }
//当前页
public int currentPage { get; set; }
//总个数
public int totalCount { get; set; }
//总页数
public int totalPage { get; set; }
}
控制器
[HttpGet]
public PageModel Show(int pageSize=2,int currentPage=1,string youhuifangshi="",string type="",string Name="" )
{
//如果当前页小于1
if (currentPage < 1)
{
currentPage = 1;
}
//显示数据
var list = dal.Show();
//查询
if (!string.IsNullOrEmpty(youhuifangshi))
{
list = list.Where(x => x.youhuifangshi == youhuifangshi).ToList();
}
if (!string.IsNullOrEmpty(type))
{
list = list.Where(x => x.type == type).ToList();
}
if (!string.IsNullOrEmpty(Name))
{
list
linq分页查询
最新推荐文章于 2021-10-12 18:04:33 发布