public async Task <IHttpActionResult> PutTurfFecilityMaster(int id, TurfFecilityMaster turfFecilityMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != turfFecilityMaster.Id) { return(BadRequest()); } db.Entry(turfFecilityMaster).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TurfFecilityMasterExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetTurfFecilityMaster(int id) { TurfFecilityMaster turfFecilityMaster = await db.TurfFecilityMasters.FindAsync(id); if (turfFecilityMaster == null) { return(NotFound()); } return(Ok(turfFecilityMaster)); }
public async Task <IHttpActionResult> PostTurfFecilityMaster(TurfFecilityMaster turfFecilityMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TurfFecilityMasters.Add(turfFecilityMaster); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = turfFecilityMaster.Id }, turfFecilityMaster)); }
public async Task <IHttpActionResult> DeleteTurfFecilityMaster(int id) { TurfFecilityMaster turfFecilityMaster = await db.TurfFecilityMasters.FindAsync(id); if (turfFecilityMaster == null) { return(NotFound()); } db.TurfFecilityMasters.Remove(turfFecilityMaster); await db.SaveChangesAsync(); return(Ok(turfFecilityMaster)); }