public async Task <RechargeProductDto> CreateAsync(RechargeProductCreateUpdateDto input) { var product = new RechargeProduct(GuidGenerator.Create(), CurrentUser.TenantId, input.Name, input.Thumbnail, input.RetailPrice, input.SalePrice, input.Quantity, input.Description, input.IsActive, input.DisplayOrder); await _repository.InsertAsync(product); return(ObjectMapper.Map <RechargeProduct, RechargeProductDto>(product)); }
public async Task <RechargeProductDto> UpdateAsync(Guid id, RechargeProductCreateUpdateDto input) { var product = await _repository.GetAsync(id); product.Update(input.Name, input.Thumbnail, input.RetailPrice, input.SalePrice, input.Quantity, input.Description, input.IsActive, input.DisplayOrder); await _repository.UpdateAsync(product); return(ObjectMapper.Map <RechargeProduct, RechargeProductDto>(product)); }
public Task <RechargeProductDto> UpdateAsync(Guid id, RechargeProductCreateUpdateDto input) { return(_service.UpdateAsync(id, input)); }
public Task <RechargeProductDto> CreateAsync(RechargeProductCreateUpdateDto input) { return(_service.CreateAsync(input)); }