public int Count(InputSearchEntity SearchInputEntity) { if (SearchInputEntity == null) { SearchInputEntity = new InputSearchEntity(); } IQueryable <Input> Inputs = context.Inputs; Apply(Inputs, SearchInputEntity); return(Inputs.Count()); }
public List <Input> List(InputSearchEntity SearchInputEntity) { if (SearchInputEntity == null) { SearchInputEntity = new InputSearchEntity(); } IQueryable <Input> Inputs = context.Inputs; Apply(Inputs, SearchInputEntity); SkipAndTake(Inputs, SearchInputEntity); return(Inputs.ToList()); }
private IQueryable <Input> Apply(IQueryable <Input> Inputs, InputSearchEntity SearchInputEntity) { if (SearchInputEntity.Id.HasValue) { Inputs = Inputs.Where(wh => wh.Id == SearchInputEntity.Id.Value); } if (SearchInputEntity.Quantity.HasValue) { Inputs = Inputs.Where(wh => wh.Quantity == SearchInputEntity.Quantity.Value); } if (SearchInputEntity.UnitPrice.HasValue) { Inputs = Inputs.Where(wh => wh.UnitPrice == SearchInputEntity.UnitPrice.Value); } if (SearchInputEntity.InventoryId.HasValue) { Inputs = Inputs.Where(wh => wh.InventoryId == SearchInputEntity.InventoryId.Value); } if (!string.IsNullOrEmpty(SearchInputEntity.Description)) { Inputs = Inputs.Where(wh => wh.Description.ToLower().Contains(SearchInputEntity.Description.ToLower())); } return(Inputs); }
public List <InputEntity> Get(EmployeeEntity EmployeeEntity, InputSearchEntity InputSearchEntity) { List <Input> Inputs = UnitOfWork.InputRepository.List(InputSearchEntity); return(Inputs.ToList().Select(c => new InputEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, InputSearchEntity InputSearchEntity) { return(UnitOfWork.InputRepository.Count(InputSearchEntity)); }
public List <InputEntity> Get(InputSearchEntity SearchInputEntity) { return(InputService.Get(EmployeeEntity, SearchInputEntity)); }
public long Count(InputSearchEntity SearchInputEntity) { return(InputService.Count(EmployeeEntity, SearchInputEntity)); }