예제 #1
0
        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);
        }
예제 #2
0
        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 }));
        }