public async Task <int> UpdateNewComment(UpdateNewCommentViewModel input) { var updateNew = newCommentDbSet.All().SingleOrDefault(t => t.Id == input.Id); updateNew.UserOpinion = input.UserOpinion; await newCommentDbSet.SaveChangesAsync(); return((int)updateNew.NewId); }
public async Task <IActionResult> UpdateNewComment(UpdateNewCommentViewModel input) { if (!this.ModelState.IsValid) { return(View(input)); } int themeId = await newCommentService.UpdateNewComment(input); return(this.RedirectToAction("PreviewNew", "News", new { id = themeId })); }