public IHttpActionResult PutTranscriptsModel(int id, TranscriptsModel transcriptsModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != transcriptsModel.id) { return(BadRequest()); } db.Entry(transcriptsModel).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TranscriptsModelExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetTranscriptsModel(int id) { TranscriptsModel transcriptsModel = db.TranscriptsModels.Find(id); if (transcriptsModel == null) { return(NotFound()); } return(Ok(transcriptsModel)); }
public IHttpActionResult PostTranscriptsModel(TranscriptsModel transcriptsModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TranscriptsModels.Add(transcriptsModel); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = transcriptsModel.id }, transcriptsModel)); }
public IHttpActionResult DeleteTranscriptsModel(int id) { TranscriptsModel transcriptsModel = db.TranscriptsModels.Find(id); if (transcriptsModel == null) { return(NotFound()); } db.TranscriptsModels.Remove(transcriptsModel); db.SaveChanges(); return(Ok(transcriptsModel)); }