public IHttpActionResult Putmulti_pitch(int id, multi_pitch multi_pitch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != multi_pitch.id_multi_pitch) { return(BadRequest()); } db.Entry(multi_pitch).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!multi_pitchExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Getmulti_pitch(int id) { multi_pitch multi_pitch = db.multi_pitch.Find(id); if (multi_pitch == null) { return(NotFound()); } return(Ok(multi_pitch)); }
public IHttpActionResult Postmulti_pitch(multi_pitch multi_pitch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.multi_pitch.Add(multi_pitch); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = multi_pitch.id_multi_pitch }, multi_pitch)); }
public IHttpActionResult Deletemulti_pitch(int id) { multi_pitch multi_pitch = db.multi_pitch.Find(id); if (multi_pitch == null) { return(NotFound()); } db.multi_pitch.Remove(multi_pitch); db.SaveChanges(); return(Ok(multi_pitch)); }