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