public ActionResult <Job> Put([FromBody] Job job) { try { return(Ok(_JobsRepo.Put(job))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IHttpActionResult PutJob(long id, Job job) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != job.Id) { return(BadRequest()); } if (!jobs.Put(job, id)) { return(NotFound()); } return(StatusCode(HttpStatusCode.NoContent)); }