// POST: odata/msTNBApprovedEquipments public async Task <IHttpActionResult> Post(msTNBApprovedEquipment msTNBApprovedEquipment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.msTNBApprovedEquipments.Add(msTNBApprovedEquipment); await db.SaveChangesAsync(); return(Created(msTNBApprovedEquipment)); }
// DELETE: odata/msTNBApprovedEquipments(5) public async Task <IHttpActionResult> Delete([FromODataUri] int key) { msTNBApprovedEquipment msTNBApprovedEquipment = await db.msTNBApprovedEquipments.FindAsync(key); if (msTNBApprovedEquipment == null) { return(NotFound()); } db.msTNBApprovedEquipments.Remove(msTNBApprovedEquipment); await db.SaveChangesAsync(); return(StatusCode(HttpStatusCode.NoContent)); }
// PUT: odata/msTNBApprovedEquipments(5) public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <msTNBApprovedEquipment> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } msTNBApprovedEquipment msTNBApprovedEquipment = await db.msTNBApprovedEquipments.FindAsync(key); if (msTNBApprovedEquipment == null) { return(NotFound()); } patch.Put(msTNBApprovedEquipment); try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!msTNBApprovedEquipmentExists(key)) { return(NotFound()); } else { throw; } } return(Updated(msTNBApprovedEquipment)); }