Example #1
0
        public IHttpActionResult PutasessionTable(int id, asessionTable asessionTable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != asessionTable.id)
            {
                return(BadRequest());
            }

            db.Entry(asessionTable).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!asessionTableExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
        public IHttpActionResult GetasessionTable(int id)
        {
            asessionTable asessionTable = db.asessionTables.Find(id);

            if (asessionTable == null)
            {
                return(NotFound());
            }

            return(Ok(asessionTable));
        }
Example #3
0
        public IHttpActionResult PostasessionTable(asessionTable asessionTable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.asessionTables.Add(asessionTable);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = asessionTable.id }, asessionTable));
        }
Example #4
0
        public IHttpActionResult DeleteasessionTable(int id)
        {
            asessionTable asessionTable = db.asessionTables.Find(id);

            if (asessionTable == null)
            {
                return(NotFound());
            }

            db.asessionTables.Remove(asessionTable);
            db.SaveChanges();

            return(Ok(asessionTable));
        }