コード例 #1
0
 public ActionResult <Artist> Create([FromBody] Artist newProd)
 {
     try
     {
         return(Ok(_service.Create(newProd)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
コード例 #2
0
 public ActionResult <Artist> Create([FromBody] Artist newArtist)
 {
     try
     {
         Artist artist = _service.Create(newArtist);
         return(Ok(artist));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }