Ejemplo n.º 1
0
 public IActionResult Create([FromBody] SongDto song)
 {
     if (!song.IsValid())
     {
         return(BadRequest());
     }
     if (songService.Create(song))
     {
         return(NoContent());
     }
     return(BadRequest());
 }
Ejemplo n.º 2
0
 public IActionResult Update([FromRoute] int id, [FromBody] SongDto song)
 {
     if (!song.IsValid())
     {
         return(BadRequest());
     }
     song.Id = id;
     if (songService.Update(song))
     {
         return(NoContent());
     }
     return(BadRequest());
 }