コード例 #1
0
        public async Task <IActionResult> DeleteCouponUser(int couponID)
        {
            Guid userID = new Guid(User.FindFirst(ClaimTypes.NameIdentifier)?.Value);

            var couponUserEntity = await couponRepository.GetCouponUserAsync(couponID, userID);

            if (couponUserEntity == null)
            {
                return(NotFound());
            }
            couponRepository.DeleteCouponUser(couponUserEntity);
            await couponRepository.SaveAsync();

            return(NoContent());
        }