public IHttpActionResult Post(ETransitionGeometryInput eTransitionGeometryInput) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ETransitionGeometryInputs.Add(eTransitionGeometryInput); try { db.SaveChanges(); } catch (DbUpdateException) { if (ETransitionGeometryInputExists(eTransitionGeometryInput.transition_id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = eTransitionGeometryInput.transition_id }, eTransitionGeometryInput)); }
public IHttpActionResult Put(int id, ETransitionGeometryInput eTransitionGeometryInput) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != eTransitionGeometryInput.transition_id) { return(BadRequest()); } db.Entry(eTransitionGeometryInput).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ETransitionGeometryInputExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Get(int id) { ETransitionGeometryInput eTransitionGeometryInput = db.ETransitionGeometryInputs.Find(id); if (eTransitionGeometryInput == null) { return(NotFound()); } return(Ok(eTransitionGeometryInput)); }
public IHttpActionResult Delete(int id) { ETransitionGeometryInput eTransitionGeometryInput = db.ETransitionGeometryInputs.Find(id); if (eTransitionGeometryInput == null) { return(NotFound()); } db.ETransitionGeometryInputs.Remove(eTransitionGeometryInput); db.SaveChanges(); return(Ok(eTransitionGeometryInput)); }