public IHttpActionResult Putarth_hotels(int id, arth_hotels arth_hotels) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != arth_hotels.id) { return(BadRequest()); } db.Entry(arth_hotels).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!arth_hotelsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Getarth_hotels(int id) { arth_hotels arth_hotels = db.arth_hotels.Find(id); if (arth_hotels == null) { return(NotFound()); } return(Ok(arth_hotels)); }
public IHttpActionResult Postarth_hotels(arth_hotels arth_hotels) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.arth_hotels.Add(arth_hotels); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = arth_hotels.id }, arth_hotels)); }
public IHttpActionResult Deletearth_hotels(int id) { arth_hotels arth_hotels = db.arth_hotels.Find(id); if (arth_hotels == null) { return(NotFound()); } db.arth_hotels.Remove(arth_hotels); db.SaveChanges(); return(Ok(arth_hotels)); }