public void UpdatePrice(Airport airport, ScalePrice scalePrice) { if (!_prices.ContainsKey(airport)) { _prices.Add(airport, scalePrice); } else { _prices[airport] = scalePrice; } }
public ScalePrice QueryPrice(Airport airport) { ScalePrice result; if (!_prices.ContainsKey(airport)) { result = new ScalePrice(null, decimal.MaxValue); _prices.Add(airport, result); } else { result = _prices[airport]; } return(result); }