public async Task <IActionResult> Remove([FromBody] TodoUpdateInput todoUpdateInput) { var result = await _todoService.Update(todoUpdateInput); if (!result.Success) { return(BadRequest(result.Message)); } return(NoContent()); }
public async Task <IResult> Update(TodoUpdateInput updateInput) { var todo = await _todoDal.Get(t => t.Id == updateInput.Id); todo.TodoItems.ToList().Where(t => t.Id == null).ToList().ForEach(t => t.Id = Guid.NewGuid()); todo.TodoItems = MapsterTool.Map <IList <TodoItemUpdateInput>, IList <TodoItem> >(updateInput.TodoItems); await _todoDal.Update(todo); return(new SuccessResult(Messages.Successfully)); }
public async Task <IActionResult> Update([FromBody] TodoUpdateInput updateInput) { var result = await _todoService.Update(updateInput); if (!result.Success) { return(BadRequest(result.Message)); } return(Ok(result.Success)); }