/// <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; });