public static void InsertCouponItem(ICouponService categorytService, decimal minAmountLimit, int rate, decimal discountAmount, DiscountType discountType) { Coupon coupon = new Coupon(); coupon.MinAmountLimit = minAmountLimit; coupon.Rate = rate; coupon.DiscountAmount = discountAmount; coupon.DiscountType = (int)discountType; categorytService.Add(coupon); }
public IActionResult Post([FromBody] Coupon body) { var entity = _manager.Add(body); return(ResponseJson(entity)); }
public async Task <IActionResult> Add([FromBody] CreateCouponModel model) { var result = await _couponService.Add(model); return(Created(result.Id.ToString(), null)); }