Example #1
0
        public async Task <ApiResponse> GetByID(int id)
        {
            var result = await userProfileCommentService.GetByIDAsync(id);

            if (result != null)
            {
                return(new ApiResponse(result, ResponseStatusCode.Success, "Successfully returned a User Profile Comment."));
            }

            return(new ApiResponse(result, ResponseStatusCode.Error, "Could not return a User Profile Comment."));
        }
Example #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));
        }