public IActionResult Post([FromBody] TodoCreateVm todo) { var result = new Todo(todo.Description); _repository.Add(result); return(CreatedAtAction(nameof(TodoController.Get), new { id = result.Id }, TodoDisplayVm.FromTodo(result))); }
public IActionResult Get([FromRoute] TodoSearchVm todo) { return(Ok(TodoDisplayVm.FromTodo(_repository[todo.Id]))); }