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