码迷,mamicode.com
首页 > 其他好文 > 详细

Func<TEntity, bool>匿名委托

时间:2020-07-07 13:28:46      阅读:63      评论:0      收藏:0      [点我收藏+]

标签:ret   fun   add   count   div   class   分页   pre   lis   

        /// <summary>
        /// 分页2
        /// </summary>
        /// <param name="current"></param>
        /// <param name="pageSize"></param>
        /// <param name="total"></param>
        /// <param name="productIds"></param>
        /// <param name="countryIds"></param>
        /// <returns></returns>
        public List<ProdCountry> ListEntities(int current, int pageSize, out int total, Func<ProdCountry, bool> func)
        {
            List<ProdCountry> list = ReadRedis();
            if (list == null || list.Count <= 0)
            {
                list = ReadDatabase();
            }
            var query = list.AsQueryable().Where(func);
            total = query.Count();

            return query.Skip((current - 1) * pageSize).Take(pageSize).ToList();
        }
var dd = new Func<ProdCountry, bool>(delegate (ProdCountry obj) { return obj.CountryId > 0; });

Func<TEntity, bool>匿名委托

标签:ret   fun   add   count   div   class   分页   pre   lis   

原文地址:https://www.cnblogs.com/lishidefengchen/p/13260035.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!