Esempio n. 1
0
        public async Task <ActionResult <CouponReadDto> > CreateCoupon(CouponCreateDto couponCreateDto)
        {
            var couponModel = _mapper.Map <Coupon>(couponCreateDto);
            var coupon      = await _repository.CreateCoupon(couponModel);

            return(CreatedAtRoute("GetCoupon", new { id = coupon.Id.ToString() }, _mapper.Map <CouponReadDto>(coupon)));
        }
Esempio n. 2
0
 public Coupon CreateCoupon(int value, string userId)
 {
     return(_couponRepo.CreateCoupon(value, userId));
 }