public async Task <ActionResult> Post(ToDo toDo) { // Create the new Guid on the server side to prevent client side "hacking"... toDo.IdToDo = Guid.NewGuid(); await toDoRepository.CreateToDo(toDo); return(Created(string.Empty, toDo)); }
public async Task <ToDo> CreateToDo(ToDo todo) { return(await _toDoRepository.CreateToDo(todo)); }