Example #1
0
        public async Task <HttpResponseMessage> DeleteAll()
        {
            await _todosService.DeleteAll();

            return(StatusCodeAndDtoWrapper.BuildSuccess("Todos Deleted Successfully"));
        }
        public async Task <HttpResponseMessage> CreateTodo([FromBody] Todo todo)
        {
            await _todosService.CreateTodo(todo);

            return(StatusCodeAndDtoWrapper.BuildSuccess(TodoDetailsDto.Build(todo), "Todo Created Successfully"));
        }
        public async Task <IActionResult> GetDetails(string slug, string commentId, CreateOrEditCommentDto model)
        {
            Comment comment = await _commentService.GetCommentByIdAsync(commentId);

            return(StatusCodeAndDtoWrapper.BuildSuccess(CommentDetailsDto.Build(comment)));
        }
 public async Task <HttpResponseMessage> UpdateTodo(int id, [FromBody] Todo todo) =>
 StatusCodeAndDtoWrapper.BuildSuccess(TodoDetailsDto.Build(await _todosService.Update(id, todo)),
                                      "Todo Updated Successfully");