public List <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state, bool?IsOpenVshop) { var vshop = DbFactory.Default.Get <VShopInfo>().Where(item => item.State == state); if (IsOpenVshop.HasValue) { vshop = vshop.Where(d => d.IsOpen == IsOpenVshop); } var rets = vshop.OrderByDescending(item => item.Id).ToPagedList(page, pageSize); total = rets.TotalRecordCount; return(rets); }
public IQueryable <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state) { var vshop = Context.VShopInfo.Where(item => item.State == state); total = vshop.Count(); return(vshop.OrderByDescending(item => item.Id).Skip((page - 1) * pageSize).Take(pageSize)); }
public IQueryable <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state) { total = this.context.VShopInfo.Count(); return(( from item in this.context.VShopInfo where (int)item.State == (int)state orderby item.Id descending select item).Skip((page - 1) * pageSize).Take(pageSize)); }
/// <summary> /// 获取所有微店(分页) /// </summary> /// <param name="page">页号</param> /// <param name="pageSize">页面大小</param> /// <param name="total">微店总数</param> /// <param name="state">微店状态</param> /// <returns></returns> public static IQueryable <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state) { return(_iVShopService.GetVShops(page, pageSize, out total, state)); }