public List <Size> GetSize( IUnitOfWork uow, SizeType sizeType = null, bool onlyUseInEmployee = false, bool onlyUseInNomenclature = false) { if (sizes is null) { sizes = SizeRepository.GetSize(uow); } var filterSizes = (IEnumerable <Size>)sizes; if (sizeType != null) { filterSizes = filterSizes.Where(x => x.SizeType == sizeType); } if (onlyUseInEmployee) { filterSizes = filterSizes.Where(x => x.UseInEmployee); } if (onlyUseInNomenclature) { filterSizes = filterSizes.Where(x => x.UseInNomenclature); } return(filterSizes.ToList()); }
public HttpResponseMessage PostSize([FromBody] int id) { var size = SizeRepository.GetSize(id); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, size); return(response); }
public void RefreshSizes(IUnitOfWork uow) => sizes = SizeRepository.GetSize(uow);