Esempio n. 1
0
        public async Task <int> DeleteUserImageComment(DeleteImageCommentViewModel input)
        {
            var imageComment = imageCommentDbSet.All().Where(x => x.Id == input.Id).FirstOrDefault();

            imageCommentDbSet.Delete(imageComment);
            await imageCommentDbSet.SaveChangesAsync();

            return((int)imageComment.ImageId);
        }
Esempio n. 2
0
        public async Task <IActionResult> DeleteImageComment(DeleteImageCommentViewModel input)
        {
            if (!ModelState.IsValid)
            {
                return(View(input));
            }

            int imageId = await imageCommentService.DeleteUserImageComment(input);

            return(this.RedirectToAction("PreviewImage", "Images", new { id = imageId }));
        }