public IActionResult Get(Guid id) { var category = couponReader.GetByIDs(new[] { id }).SingleOrDefault(); if (category == null) { return(NotFound()); } return(Ok(category)); }
private Coupon.Coupon EnsureCoupon(ApplyCouponCommand request) { var coupon = couponReader.GetByIDs(new[] { request.CouponID }).SingleOrDefault(); if (coupon == null) { throw new CouponNotFoundException(request.ID); } return(coupon); }