public DoDocModel GetModel(IAreal key, bool floodplain) { DoDocModel result = _models.GetOrAdd(key, k => floodplain?((DoDocModel) new FloodplainDoDoc()):(new RoutingDoDoc())); result.Areal = key; return(result); }
public DoDocModel GetModel(IAreal key) { bool floodplain; var hasValue = IsFloodPlain.TryGetValue(key, out floodplain); // storages wont set anything in IsFloodPlain but by default use the FloodplainDoDoc if (!hasValue) { floodplain = true; } var result = _models.GetOrAdd(key, k => floodplain?((DoDocModel) new FloodplainDoDoc()):(new RoutingDoDoc())); result.Areal = key; return(result); }