public async Task Update(Guid id, UpdateCouponModel model) { var coupon = await _couponRepository.GetById(id); coupon.Update(model.Name, model.Category, model.ExpirationDate, model.Description); _couponRepository.Update(coupon); await _couponRepository.SaveChanges(); }
public async Task <IActionResult> Update([FromRoute] Guid couponId, [FromBody] UpdateCouponModel model) { await _couponService.Update(couponId, model); return(NoContent()); }