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); }
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 })); }