/// <summary>
 /// Creates a new instance of <see cref="TwitterIntegrationBackgroundService"/>.
 /// </summary>
 /// <param name="serviceProvider">An instance of <see cref="IServiceProvider"/>, used for dependency injection.</param>
 /// <param name="logger">An instance of <see cref="ILogger"/>, used to write logs.</param>
 /// <param name="apiConfiguration">API configuration settings, used in appsettings.json under the 'Api' key.</param>
 /// <param name="blashHub">The SignalR chat hub context.</param>
 /// <param name="twitterIntegrationJobService">An instance of the job service, so we can run the tasks.</param>
 /// <param name="hostApplicationLifetime">An instance of the lifetime, so we can get the cancellation token.</param>
 public TwitterIntegrationBackgroundService([NotNull] IServiceProvider serviceProvider,
                                            [NotNull] ILogger <TwitterIntegrationBackgroundService> logger, [NotNull] IOptions <ApiConfiguration> apiConfiguration,
                                            [NotNull] IHubContext <BlashHub> blashHub,
                                            [NotNull] ITwitterIntegrationJobService twitterIntegrationJobService,
                                            [NotNull] IHostApplicationLifetime hostApplicationLifetime)
 {
     _serviceProvider              = serviceProvider;
     _apiConfiguration             = apiConfiguration;
     _logger                       = logger;
     _blashHub                     = blashHub;
     _twitterIntegrationJobService = twitterIntegrationJobService;
     _hostApplicationLifetime      = hostApplicationLifetime;
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a new instance of <see cref="DashboardController"/>.
        /// </summary>
        /// <param name="serviceProvider">An instance of <see cref="IServiceProvider"/>.</param>
        /// <param name="dashboardService">An instance of <see cref="IDashboardService"/>.</param>
        /// <param name="tweetService">An instance of <see cref="ITweetService"/>.</param>
        /// <param name="blashDbContext">An instance of <see cref="BlashDbContext"/>.</param>
        /// <param name="twitterApiRuleService">An instance of <see cref="ITwitterApiRuleService"/>.</param>
        /// <param name="logger">An instance of <see cref="ILogger"/>, used to write logs.</param>
        /// <param name="twitterIntegrationJobService">An instance of <see cref="ITwitterIntegrationJobService"/>.</param>
        /// <param name="blashHub">The SignalR chat hub.</param>
        /// <param name="hostApplicationLifetime">An instance of the lifetime, so we can get the cancellation token.</param>
        public DashboardController([NotNull] IServiceProvider serviceProvider, [NotNull] IDashboardService dashboardService,
                                   [NotNull] ITweetService tweetService, [NotNull] BlashDbContext blashDbContext,
                                   [NotNull] ITwitterApiRuleService twitterApiRuleService, [NotNull] ILogger <DashboardController> logger,
                                   [NotNull] ITwitterIntegrationJobService twitterIntegrationJobService, [NotNull] IHubContext <BlashHub> blashHub,
                                   [NotNull] IHostApplicationLifetime hostApplicationLifetime)
        {
            _serviceProvider  = serviceProvider;
            _dashboardService = dashboardService;
            _tweetService     = tweetService;
            _blashDbContext   = blashDbContext;

            _twitterApiRuleService = twitterApiRuleService;
            _logger = logger;
            _twitterIntegrationJobService = twitterIntegrationJobService;
            _blashHub = blashHub;
            _hostApplicationLifetime = hostApplicationLifetime;
        }