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)); }
public IHttpActionResult GetasessionTable(int id) { asessionTable asessionTable = db.asessionTables.Find(id); if (asessionTable == null) { return(NotFound()); } return(Ok(asessionTable)); }
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)); }
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)); }