public async Task Run(CancellationToken cancellationToken) { for (var i = 0; i < Repeats; i++) { await InnerJob.Run(cancellationToken); } }
public async Task <IHttpActionResult> PutInnerJob(int id, InnerJob innerJob) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != innerJob.Id) { return(BadRequest()); } db.Entry(innerJob).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InnerJobExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetInnerJob(int id) { InnerJob innerJob = await db.InnerJobs.FindAsync(id); if (innerJob == null) { return(NotFound()); } return(Ok(innerJob)); }
public async Task <IHttpActionResult> PostInnerJob(InnerJob innerJob) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.InnerJobs.Add(innerJob); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = innerJob.Id }, innerJob)); }
public async Task <IHttpActionResult> DeleteInnerJob(int id) { InnerJob innerJob = await db.InnerJobs.FindAsync(id); if (innerJob == null) { return(NotFound()); } db.InnerJobs.Remove(innerJob); await db.SaveChangesAsync(); return(Ok(innerJob)); }