예제 #1
0
 public ActionResult <Dog> Create([FromBody] Dog newDog) //NOTE "From the body, create a dog called newDog")
 {
     try
     {
         return(Ok(_ds.Create(newDog)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
예제 #2
0
 public ActionResult <Dog> Create([FromBody] Dog newDog)
 {
     try
     {
         Dog dog = _ds.Create(newDog);
         return(Ok(dog));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }