/// <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; }
/// <summary> /// Creates a new instance of <see cref="ImportRulesFromTwitterApiTask"/>. /// </summary> /// <param name="serviceProvider">An instance of <see cref="IServiceProvider"/>, used for dependency injection.</param> /// <param name="cancellationToken">The cancellation token.</param> public ImportRulesFromTwitterApiTask([NotNull] IServiceProvider serviceProvider, [NotNull] CancellationToken cancellationToken) : base(serviceProvider, cancellationToken) { _twitterApiRuleService = serviceProvider.GetService <ITwitterApiRuleService>(); }