コード例 #1
0
        public async Task <ActionResult <bool> > DeleteReview(DeleteReviewInputModel input)
        {
            var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);

            await this.reviewsService.DeleteReviewAsync(input.ReviewNumber, userId);

            return(true);
        }
コード例 #2
0
        public async Task <IActionResult> Delete(DeleteReviewInputModel model)
        {
            try
            {
                await this.reviewService.DeleteReviewsAsync(model.Id);
            }
            catch (ArgumentException ex)
            {
                return(this.RedirectToAction("Home", "Error404"));
            }

            return(this.RedirectToAction("Details", new { id = model.GameId, pageNumber = 1 }));
        }