public async Task <ActionResult <ToDoItem> > Create(ToDoItem todoItem) { var createdItem = await _todoContext.Create(todoItem); if (createdItem == null) { return(BadRequest()); } return(CreatedAtAction(nameof(Get), new { id = todoItem.Id }, todoItem)); }