public IHttpActionResult PutSculpture_Type(int id, Sculpture_Type sculpture_Type) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != sculpture_Type.ID) { return(BadRequest()); } db.Entry(sculpture_Type).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Sculpture_TypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetSculpture_Type(int id) { Sculpture_Type sculpture_Type = db.Sculpture_Type.Find(id); if (sculpture_Type == null) { return(NotFound()); } return(Ok(sculpture_Type)); }
public IHttpActionResult PostSculpture_Type(Sculpture_Type sculpture_Type) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Sculpture_Type.Add(sculpture_Type); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = sculpture_Type.ID }, sculpture_Type)); }
public IHttpActionResult DeleteSculpture_Type(int id) { Sculpture_Type sculpture_Type = db.Sculpture_Type.Find(id); if (sculpture_Type == null) { return(NotFound()); } db.Sculpture_Type.Remove(sculpture_Type); db.SaveChanges(); return(Ok(sculpture_Type)); }