public static IFlightProvider GetFlightProvider() { Lock.EnterReadLock(); try { { if (_provider == null) { if (Configuration.IsMock) _provider = new MockFlightProvider(); else _provider = new FlightProvider(CacheProviderFactory.GetFlightResultsCacheProvider()); } } } finally { Lock.ExitReadLock(); } return _provider; }
public FlightController(IFlightProvider flightProvider) { Condition.Requires(flightProvider, nameof(flightProvider)).IsNotNull(); _flightProvider = flightProvider; }