public IHttpActionResult Put(int id, ArtistApiModel artist) { if (artist == null) { return this.BadRequest("No data"); } if (this.artistService.Update(id, artist.Name, artist.DateOfBirth, artist.Country)) { return this.Ok(); } return this.NotFound(); }
public IHttpActionResult Post(ArtistApiModel artist) { if (!this.ModelState.IsValid) { return this.BadRequest(this.ModelState); } if (artist == null) { return this.BadRequest("No data"); } this.artistService.Add(artist.Name, artist.DateOfBirth, artist.Country); return this.Ok(); }