Exemple #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());
        }
Exemple #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));
        }