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