// PUT api/MwoAMatchMetric/5 public IHttpActionResult PutMwoAMatchMetric(int id, MwoAMatchMetric mwoamatchmetric) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mwoamatchmetric.MwoAMatchMetricId) { return(BadRequest()); } db.Entry(mwoamatchmetric).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MwoAMatchMetricExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostMwoAMatchMetric(MwoAMatchMetric mwoamatchmetric) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MwoAMatchMetrics.Add(mwoamatchmetric); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = mwoamatchmetric.MwoAMatchMetricId }, mwoamatchmetric)); }
public IHttpActionResult DeleteMwoAMatchMetric(int id) { MwoAMatchMetric mwoamatchmetric = db.MwoAMatchMetrics.Find(id); if (mwoamatchmetric == null) { return(NotFound()); } db.MwoAMatchMetrics.Remove(mwoamatchmetric); db.SaveChanges(); return(Ok(mwoamatchmetric)); }