public HttpResponseMessage Post(Artist a) { if (a == null) { return new HttpResponseMessage(HttpStatusCode.BadRequest); } dbContext.Artist.Add(a); dbContext.SaveChanges(); return new HttpResponseMessage(HttpStatusCode.Created); }
public HttpResponseMessage Put(int id, Artist a) { var artist = dbContext.Artist.Find(a); if (artist == null) { return new HttpResponseMessage(HttpStatusCode.BadRequest); } artist.Name = a.Name; dbContext.SaveChanges(); return new HttpResponseMessage(HttpStatusCode.OK); }