// POST: odata/eMis_Mobile public IHttpActionResult Post(eMis_Mobile eMis_Mobile) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.eMis_Mobile.Add(eMis_Mobile); try { db.SaveChanges(); } catch (DbUpdateException) { if (eMis_MobileExists(eMis_Mobile.Cntrl_num)) { return(Conflict()); } else { throw; } } return(Created(eMis_Mobile)); }
// DELETE: odata/eMis_Mobile(5) public IHttpActionResult Delete([FromODataUri] int key) { eMis_Mobile eMis_Mobile = db.eMis_Mobile.Find(key); if (eMis_Mobile == null) { return(NotFound()); } db.eMis_Mobile.Remove(eMis_Mobile); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
// PUT: odata/eMis_Mobile(5) public IHttpActionResult Put([FromODataUri] int key, Delta <eMis_Mobile> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } eMis_Mobile eMis_Mobile = db.eMis_Mobile.Find(key); if (eMis_Mobile == null) { return(NotFound()); } patch.Put(eMis_Mobile); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!eMis_MobileExists(key)) { return(NotFound()); } else { throw; } } return(Updated(eMis_Mobile)); }