public async Task <IActionResult> DeleteComment(int id)
        {
            // Deletes comment and returns error if unsuccessful
            Result result = await _repository.DeleteCommentAsync(id);

            if (result.Failure)
            {
                return(StatusCode(result.Code, result.Error));
            }

            // Saves changes and returns response
            await _repository.SaveChangesAsync();

            return(Ok());
        }
        public async Task <IActionResult> DeleteComment(int id)
        {
            // Deletes the comment and saves changes if successful
            Result result = await _repository.DeleteCommentAsync(id);

            if (result.Failure)
            {
                return(StatusCode(result.Code));
            }

            await _repository.SaveChangesAsync();

            // Creates model and returns view
            MessageViewModel model = new MessageViewModel()
            {
                Title        = "Comment deleted",
                MessageTitle = "Comment deleted"
            };

            return(View("Message", model));
        }