public async Task <IHttpActionResult> PutDepopulation_Batch(int id, Depopulation_Batch depopulation_Batch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != depopulation_Batch.did) { return(BadRequest()); } db.Entry(depopulation_Batch).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Depopulation_BatchExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetDepopulation_Batch(int id) { Depopulation_Batch depopulation_Batch = await db.Depopulation_Batch.FindAsync(id); if (depopulation_Batch == null) { return(NotFound()); } return(Ok(depopulation_Batch)); }
public async Task <IHttpActionResult> PostDepopulation_Batch(Depopulation_Batch depopulation_Batch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Depopulation_Batch.Add(depopulation_Batch); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = depopulation_Batch.did }, depopulation_Batch)); }
public async Task <IHttpActionResult> DeleteDepopulation_Batch(int id) { Depopulation_Batch depopulation_Batch = await db.Depopulation_Batch.FindAsync(id); if (depopulation_Batch == null) { return(NotFound()); } db.Depopulation_Batch.Remove(depopulation_Batch); await db.SaveChangesAsync(); return(Ok(depopulation_Batch)); }