public async Task CreateSize(string sizeText) { var sizes = await _sizeRepository.Get(); var lastSize = sizes.OrderByDescending(x => x.SizeOrder).FirstOrDefault(); var sizeOrder = lastSize?.SizeOrder ?? 0; var size = new Size { SizeText = sizeText, SizeOrder = sizeOrder + 1 }; var entity = _mapper.Map <Entities.Size>(size); await _sizeRepository.Create(entity); }
public async Task <UnitPrices> GetUnitPriceBySizeId(int SizeId) { var model = new UnitPrices(); model.UnitPriceBySize = await unitPriceRepository.GetUnitPriceBySizeId(SizeId); var size = await sizeRepository.Get(SizeId); model.SizeName = size.SizeName; return(model); }
public async Task <List <Size> > Get() { var sizes = await sizeRepository.Get(); return(sizes); }
public async Task <SizeView> Get(int SizeId) { return(await sizeRepository.Get(SizeId)); }
public async Task <Size> Get(int id) { return(await _repository.Get(id)); }
public Task <IEnumerable <Size> > GetSizes() => _sizeRepository.Get();