public IHttpActionResult Putjob_posting(job_posting job_posting) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Entry(job_posting).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!job_postingExists(job_posting.id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Getjob_posting(int id) { job_posting job_posting = db.job_posting.Find(id); if (job_posting == null) { return(NotFound()); } return(Ok(job_posting)); }
public IHttpActionResult Postjob_posting(job_posting job_posting) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.job_posting.Add(job_posting); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = job_posting.id }, job_posting)); }
public IHttpActionResult Deletejob_posting(int id) { job_posting job_posting = db.job_posting.Find(id); if (job_posting == null) { return(NotFound()); } db.job_posting.Remove(job_posting); db.SaveChanges(); return(Ok(job_posting)); }