Exemplo n.º 1
0
        public async Task <IActionResult> Delete(UserProfileCommentDeleteViewModel viewModel)
        {
            UserProfileComment comment = await userProfileCommentService.GetByIDAsync(viewModel.UserProfileComment.ID);

            if (comment == null)
            {
                return(NotFound());
            }

            await userProfileCommentService.DeleteAsync(comment.ID);

            return(View());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            UserProfileComment comment = await userProfileCommentService.GetByIDAsync((int)id);

            if (comment == null)
            {
                return(NotFound());
            }

            UserProfileCommentDeleteViewModel viewModel = new UserProfileCommentDeleteViewModel
            {
                UserProfileComment = comment
            };

            return(View(viewModel));
        }