コード例 #1
0
        public async Task <int> DeleteThemeComment(DeleteThemeCommentViewModel input)
        {
            var themeComment = themeCommentDbSet.All().Where(x => x.Id == input.Id).FirstOrDefault();

            themeCommentDbSet.Delete(themeComment);
            await themeCommentDbSet.SaveChangesAsync();

            return((int)themeComment.ThemeId);
        }
コード例 #2
0
        public async Task <IActionResult> DeleteThemeComment(DeleteThemeCommentViewModel input)
        {
            if (!ModelState.IsValid)
            {
                return(View(input));
            }

            int themeId = await themeCommentService.DeleteThemeComment(input);

            return(this.RedirectToAction("PreviewTheme", "Themes", new { id = themeId }));
        }