public IHttpActionResult RiskMap(Guid id, RiskMapUpdate update) { RiskMap riskMap = repo().UpdateRiskMap(id, update); if (riskMap == null) return NotFound(); return Ok(riskMap); } // RiskMap
public IHttpActionResult RiskMap(RiskMapUpdate newRiskMap) { RiskMap riskMap = repo().CreateRiskMap(newRiskMap); if (riskMap == null) return NotFound(); return Ok(riskMap); } // RiskMap
} // CreateRiskMap public RiskMap UpdateRiskMap(Guid id, RiskMapUpdate update) { var r = riskMapData(id); if (r == null) return null; r.Name = update.Name; r.RiskIds = update.RiskIds; Commit(r); riskMaps_ = null; return RiskMap(id); } // UpdateRiskMap
} // riskMapData public RiskMap CreateRiskMap(RiskMapUpdate riskMap) { var newRiskMap = new RiskMapData(); newRiskMap.Id = Guid.NewGuid(); newRiskMap.Name = riskMap.Name; newRiskMap.OwningOrganisation = orgId_; newRiskMap.RiskIds = riskMap.RiskIds; context.RiskMaps.Add(newRiskMap); Commit(); riskMaps_ = null; return RiskMap(newRiskMap.Id); } // CreateRiskMap