public int Count(CouponSearchEntity SearchCouponEntity) { if (SearchCouponEntity == null) { SearchCouponEntity = new CouponSearchEntity(); } IQueryable <Coupon> Coupons = context.Coupons; Apply(Coupons, SearchCouponEntity); return(Coupons.Count()); }
private IQueryable <Coupon> Apply(IQueryable <Coupon> Coupons, CouponSearchEntity SearchCouponEntity) { if (SearchCouponEntity.Id.HasValue) { Coupons = Coupons.Where(wh => wh.Id == SearchCouponEntity.Id.Value); } if (!string.IsNullOrEmpty(SearchCouponEntity.Code)) { Coupons = Coupons.Where(T => T.Code.ToLower().Contains(SearchCouponEntity.Code.ToLower())); } return(Coupons); }
public List <Coupon> List(CouponSearchEntity SearchCouponEntity) { if (SearchCouponEntity == null) { SearchCouponEntity = new CouponSearchEntity(); } IQueryable <Coupon> Coupons = context.Coupons; Apply(Coupons, SearchCouponEntity); SkipAndTake(Coupons, SearchCouponEntity); return(Coupons.ToList()); }
public List <CouponEntity> Get(CouponSearchEntity SearchCouponEntity) { return(CouponService.Get(EmployeeEntity, SearchCouponEntity)); }
public long Count(CouponSearchEntity SearchCouponEntity) { return(CouponService.Count(EmployeeEntity, SearchCouponEntity)); }
public List <CouponEntity> Get(EmployeeEntity EmployeeEntity, CouponSearchEntity CouponSearchEntity) { List <Coupon> Coupons = UnitOfWork.CouponRepository.List(CouponSearchEntity); return(Coupons.ToList().Select(c => new CouponEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, CouponSearchEntity CouponSearchEntity) { return(UnitOfWork.CouponRepository.Count(CouponSearchEntity)); }