public int Count(PackSearchEntity PackSearchEntity) { if (PackSearchEntity == null) { PackSearchEntity = new PackSearchEntity(); } IQueryable <Pack> Packs = context.Packs; Apply(Packs, PackSearchEntity); return(Packs.Count()); }
public List <Pack> List(PackSearchEntity PackSearchEntity) { if (PackSearchEntity == null) { PackSearchEntity = new PackSearchEntity(); } IQueryable <Pack> Packs = context.Packs .Include(p => p.Product).ThenInclude(pro => pro.ProductValues); Apply(Packs, PackSearchEntity); SkipAndTake(Packs, PackSearchEntity); return(Packs.ToList()); }
private IQueryable <Pack> Apply(IQueryable <Pack> Packs, PackSearchEntity PackSearchEntity) { if (PackSearchEntity.Id.HasValue) { Packs = Packs.Where(wh => wh.Id == PackSearchEntity.Id.Value); } if (PackSearchEntity.ProductId.HasValue) { Packs = Packs.Where(wh => wh.ProductId == PackSearchEntity.ProductId.Value); } if (PackSearchEntity.UnitPrice.HasValue) { Packs = Packs.Where(wh => wh.UnitPrice == PackSearchEntity.UnitPrice.Value); } if (PackSearchEntity.Quantity.HasValue) { Packs = Packs.Where(wh => wh.Quantity == PackSearchEntity.Quantity.Value); } if (PackSearchEntity.IsDefault.HasValue) { Packs = Packs.Where(wh => wh.IsDefault == PackSearchEntity.IsDefault.Value); } return(Packs); }
public List <PackEntity> Get(EmployeeEntity EmployeeEntity, PackSearchEntity PackSearchEntity) { List <Pack> Packs = UnitOfWork.PackRepository.List(PackSearchEntity); return(Packs.ToList().Select(c => new PackEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, PackSearchEntity PackSearchEntity) { return(UnitOfWork.PackRepository.Count(PackSearchEntity)); }
public List <PackEntity> Get(PackSearchEntity SearchPackEntity) { return(PackService.Get(EmployeeEntity, SearchPackEntity)); }
public long Count(PackSearchEntity SearchPackEntity) { return(PackService.Count(EmployeeEntity, SearchPackEntity)); }