/// <summary> /// Constructs a new instance of the <see cref="ServiceBusRealtimeDataRepository"/>. /// </summary> public ServiceBusRealtimeDataRepository(IPathDataRepository pathDataRepository, Flags flags, IServiceBusFactory managementClientFactory) { this.pathDataRepository = pathDataRepository; this.managementClientFactory = managementClientFactory; this.serviceBusSubscriptionId = flags.ServiceBusSubscriptionId ?? Guid.NewGuid().ToString(); this.pathDataRepository.OnDataUpdate += this.PathSqlDbUpdated; this.subscriptionClients = new ConcurrentDictionary <Station, ISubscriptionClient>(); this.realtimeData = new ConcurrentDictionary <Tuple <Station, RouteDirection>, List <RealtimeData> >(); }
/// <summary> /// Constructs a new instance of the <see cref="StationsApi"/>. /// </summary> /// <param name="flags">Flags instance containing the app configuration.</param> /// <param name="realtimeDataRepository">The repository to use when looking up realtime data.</param> /// <param name="pathDataRepository">The repository to use when looking up static path data.</param> public StationsApi(IRealtimeDataRepository realtimeDataRepository, IPathDataRepository pathDataRepository) { this.realtimeDataRepository = realtimeDataRepository; this.pathDataRepository = pathDataRepository; }
/// <summary> /// Constructs a new instance of the <see cref="RoutesApi"/>. /// </summary> /// <param name="pathDataRepository">The repository to use when looking up static path data.</param> public RoutesApi(IPathDataRepository pathDataRepository) { this.pathDataRepository = pathDataRepository; }