public IHttpActionResult PutRisk_Period(int id, Risk_Period risk_Period) { db.Configuration.ProxyCreationEnabled = false; if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != risk_Period.RiskP_ID) { return(BadRequest()); } db.Entry(risk_Period).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Risk_PeriodExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetRisk_Period(int id) { Risk_Period risk_Period = db.Risk_Period.Find(id); if (risk_Period == null) { return(NotFound()); } return(Ok(risk_Period)); }
public IHttpActionResult GetRisk_Period(int id) { db.Configuration.ProxyCreationEnabled = false; Risk_Period risk_Period = db.Risk_Period.Find(id); if (risk_Period == null) { return(NotFound()); } return(Ok(risk_Period)); }
public IHttpActionResult PostRisk_Period(Risk_Period risk_Period) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Risk_Period.Add(risk_Period); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = risk_Period.RiskP_ID }, risk_Period)); }
public IHttpActionResult DeleteRisk_Period(int id) { Risk_Period risk_Period = db.Risk_Period.Find(id); if (risk_Period == null) { return(NotFound()); } db.Risk_Period.Remove(risk_Period); db.SaveChanges(); return(Ok(risk_Period)); }
public IHttpActionResult DeleteRisk_Period(int id) { db.Configuration.ProxyCreationEnabled = false; Risk_Period risk_Period = db.Risk_Period.Find(id); if (risk_Period == null) { return(NotFound()); } db.Risk_Period.Remove(risk_Period); db.SaveChanges(); return(Ok(risk_Period)); }