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