public IHttpActionResult Posthired_alumni(hired_alumni hired_alumni) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.hired_alumni.Add(hired_alumni); try { db.SaveChanges(); } catch (DbUpdateException) { if (hired_alumniExists(hired_alumni.alumni_id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = hired_alumni.alumni_id }, hired_alumni)); }
public IHttpActionResult Puthired_alumni(int id, hired_alumni hired_alumni) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != hired_alumni.alumni_id) { return(BadRequest()); } db.Entry(hired_alumni).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!hired_alumniExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Gethired_alumni(int id) { hired_alumni hired_alumni = db.hired_alumni.Find(id); if (hired_alumni == null) { return(NotFound()); } return(Ok(hired_alumni)); }
public IHttpActionResult Deletehired_alumni(int id) { hired_alumni hired_alumni = db.hired_alumni.Find(id); if (hired_alumni == null) { return(NotFound()); } db.hired_alumni.Remove(hired_alumni); db.SaveChanges(); return(Ok(hired_alumni)); }