// POST: odata/T_DFDW public IHttpActionResult Post(T_DFDW T_DFDW) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.T_DFDW.Add(T_DFDW); db.SaveChanges(); return(Created(T_DFDW)); }
// DELETE: odata/T_DFDW(5) public IHttpActionResult Delete([FromODataUri] decimal key) { T_DFDW T_DFDW = db.T_DFDW.Find(key); if (T_DFDW == null) { return(NotFound()); } db.T_DFDW.Remove(T_DFDW); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Patch([FromODataUri] decimal key, Delta <T_DFDW> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } T_DFDW T_DFDW = db.T_DFDW.Find(key); if (T_DFDW == null) { return(NotFound()); } patch.Patch(T_DFDW); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!T_DFDWExists(key)) { return(NotFound()); } else { throw; } } return(Updated(T_DFDW)); }