public IHttpActionResult Put(ToDoViewModel toDoViewModel, int id) { if (!_toDoServices.ToDoExist(id)) { return NotFound(); } _toDoServices.UpdateToDo(Mapper.Map<ToDoViewModel,ToDo>(toDoViewModel),id); return Ok(); }
public IHttpActionResult Post(ToDoViewModel toDoViewModel) { _toDoServices.AddToDo(Mapper.Map<ToDoViewModel, ToDo>(toDoViewModel), User.Identity.Name); return Ok(); }