public async Task <IHttpActionResult> Putschipklasse(int id, schipklasses schipklasse) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != schipklasse.KLASSEID) { return(BadRequest()); } db.Entry(schipklasse).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!schipklasseExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Getschipklasse(int id) { schipklasses schipklasse = await db.schipklasse.FindAsync(id); if (schipklasse == null) { return(NotFound()); } return(Ok(schipklasse)); }
public async Task <IHttpActionResult> Postschipklasse(schipklasses schipklasse) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.schipklasse.Add(schipklasse); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = schipklasse.KLASSEID }, schipklasse)); }
public async Task <IHttpActionResult> Deleteschipklasse(int id) { schipklasses schipklasse = await db.schipklasse.FindAsync(id); if (schipklasse == null) { return(NotFound()); } db.schipklasse.Remove(schipklasse); await db.SaveChangesAsync(); return(Ok(schipklasse)); }