public async Task <int> UpdateImageComment(UpdateImageCommentViewModel input) { var updateImage = imageCommentDbSet.All().SingleOrDefault(t => t.Id == input.Id); updateImage.UserOpinion = input.UserOpinion; await imageCommentDbSet.SaveChangesAsync(); return((int)updateImage.ImageId); }
public async Task <IActionResult> UpdateImageComment(UpdateImageCommentViewModel input) { if (!this.ModelState.IsValid) { return(View(input)); } int imageId = await imageCommentService.UpdateImageComment(input); return(this.RedirectToAction("PreviewImage", "Images", new { id = imageId })); }