Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }