本人新手刚在webform转到mvc 像linq ef啥的,都是不会的不行不行的,不会就问群友,找资料
今天本屌遇到了一个分页组合查询的问题,解决了2个小时,把代码共享给大家
话不多话,直接上代码,理论上的东东我就不描述,初中没毕业文化太低也描述不了
新建一个表达式数的操作类
public static class PredicateBuilder{public static Expression
基本的做好,下一步就是调用了
代码 下看
//获取页容量int pageSize = FytRequest.GetFormInt("rows", 10);//获取请求的页码int pageIndex = FytRequest.GetFormInt("page", 1);var key = FytRequest.GetFormStringEncode("key");int statu = FytRequest.GetFormInt("statu");var begintime = FytRequest.GetFormString("begintime");var endtime = FytRequest.GetFormString("endtime");var where = PredicateBuilder.True
ok好了,这样就可以用了,我这个分页内部是接口做的,
爽来的,我把分页实现也分享给大家,
#region 6.0 分页查询 + List
有些人可能看代码很熟悉,就不要拆穿了,你懂得
交流:86594082 有事情可以找我哈,共同学习