Ejemplo n.º 1
0
 public ActionResult CreateToDo(Entities.Concrete.ToDo entity)
 {
     try
     {
         _toDoService.Create(entity);
         return(Ok());
     }
     catch (Exception)
     {
         return(BadRequest(entity));
     }
 }
Ejemplo n.º 2
0
        public ActionResult UpdateToDo(int id, Entities.Concrete.ToDo entity)
        {
            if (id != entity.Id)
            {
                return(BadRequest());
            }
            var toDo = _toDoService.GetById(id);

            if (toDo == null)
            {
                return(NotFound());
            }
            toDo.Name = entity.Name;
            return(NoContent());
        }