// PUT api/vwMatchMetric/5 public IHttpActionResult PutvwMatchMetric(int id, vwMatchMetric vwmatchmetric) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != vwmatchmetric.vwMatchMetricId) { return(BadRequest()); } db.Entry(vwmatchmetric).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!vwMatchMetricExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetvwMatchMetric(int id) { vwMatchMetric vwmatchmetric = db.vwMatchMetrics.Find(id); if (vwmatchmetric == null) { return(NotFound()); } return(Ok(vwmatchmetric)); }
public IHttpActionResult PostvwMatchMetric(vwMatchMetric vwmatchmetric) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.vwMatchMetrics.Add(vwmatchmetric); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = vwmatchmetric.vwMatchMetricId }, vwmatchmetric)); }
public IHttpActionResult DeletevwMatchMetric(int id) { vwMatchMetric vwmatchmetric = db.vwMatchMetrics.Find(id); if (vwmatchmetric == null) { return(NotFound()); } db.vwMatchMetrics.Remove(vwmatchmetric); db.SaveChanges(); return(Ok(vwmatchmetric)); }