public IHttpActionResult PuttAssessement(int id, tAssessement tAssessement) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tAssessement.id) { return(BadRequest()); } db.Entry(tAssessement).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!tAssessementExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GettAssessement(int id) { tAssessement tAssessement = db.tAssessements.Find(id); if (tAssessement == null) { return(NotFound()); } return(Ok(tAssessement)); }
public IHttpActionResult PosttAssessement(tAssessement tAssessement) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tAssessements.Add(tAssessement); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = tAssessement.id }, tAssessement)); }
public IHttpActionResult DeletetAssessement(int id) { tAssessement tAssessement = db.tAssessements.Find(id); if (tAssessement == null) { return(NotFound()); } db.tAssessements.Remove(tAssessement); db.SaveChanges(); return(Ok(tAssessement)); }