public IHttpActionResult PutLoc_Des(int id, Loc_Des loc_Des) { db.Configuration.ProxyCreationEnabled = false; if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != loc_Des.Loc_Des_ID) { return(BadRequest()); } db.Entry(loc_Des).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Loc_DesExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetLoc_Des(int id) { Loc_Des loc_Des = db.Loc_Des.Find(id); if (loc_Des == null) { return(NotFound()); } return(Ok(loc_Des)); }
public IHttpActionResult GetLoc_Des(int id) { db.Configuration.ProxyCreationEnabled = false; Loc_Des loc_Des = db.Loc_Des.Find(id); if (loc_Des == null) { return(NotFound()); } return(Ok(loc_Des)); }
public IHttpActionResult PostLoc_Des(Loc_Des loc_Des) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Loc_Des.Add(loc_Des); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = loc_Des.Loc_Des_ID }, loc_Des)); }
public IHttpActionResult PostLoc_Des(Loc_Des loc_Des) { //db.Configuration.ProxyCreationEnabled = false; if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Loc_Des.Add(loc_Des); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = loc_Des.Loc_Des_ID }, loc_Des)); }
public IHttpActionResult DeleteLoc_Des(int id) { Loc_Des loc_Des = db.Loc_Des.Find(id); if (loc_Des == null) { return(NotFound()); } db.Loc_Des.Remove(loc_Des); db.SaveChanges(); return(Ok(loc_Des)); }
public IHttpActionResult DeleteLoc_Des(int id) { db.Configuration.ProxyCreationEnabled = false; Loc_Des loc_Des = db.Loc_Des.Find(id); if (loc_Des == null) { return(NotFound()); } db.Loc_Des.Remove(loc_Des); db.SaveChanges(); return(Ok(loc_Des)); }