public async Task AddTodoItem(string title, string description) { if (string.IsNullOrWhiteSpace(title)) { return; } await _todoItemService.AddTodoItem(title, description); await UpdateTodoItems(); }
public async Task <ActionResult <TodoItem> > AddTodoItem(TodoItem todoItem) { await _todoItemService.AddTodoItem(todoItem); return(CreatedAtAction(nameof(GetById), new { id = todoItem.Id }, todoItem)); }