/// <summary> /// Initializes a new instance of the <see cref="PostController"/> class. /// </summary> /// <param name="logger">Sends logs to the Application Insights service.</param> /// <param name="telemetryClient">The Application Insights telemetry client.</param> /// <param name="postStorageHelper">Helper for creating models and filtering posts as per criteria.</param> /// <param name="postStorageProvider">Provides methods for add, update and delete post operations from database.</param> /// <param name="postSearchService">Post search service for fetching post with search criteria and filters.</param> public PostController( ILogger <TeamPostController> logger, TelemetryClient telemetryClient, IPostStorageHelper postStorageHelper, IPostStorageProvider postStorageProvider, IPostSearchService postSearchService) : base(telemetryClient) { this.logger = logger; this.postStorageHelper = postStorageHelper; this.postStorageProvider = postStorageProvider; this.postSearchService = postSearchService; }
/// <summary> /// Initializes a new instance of the <see cref="DigestNotificationHelper"/> class. /// </summary> /// <param name="logger">Instance to send logs to the Application Insights service.</param> /// <param name="localizer">The current cultures' string localizer.</param> /// <param name="botOptions">A set of key/value application configuration properties for bot.</param> /// <param name="adapter">Bot adapter.</param> /// <param name="teamPreferenceStorageProvider">Storage provider for team preference.</param> /// <param name="teamPostSearchService">The team post search service dependency injection.</param> /// <param name="teamPostStorageHelper">Team post storage helper dependency injection.</param> /// <param name="teamTagStorageProvider">Provider to fetch tab configuration for team.</param> /// <param name="options">A set of key/value application configuration properties.</param> public DigestNotificationHelper( ILogger <DigestNotificationHelper> logger, IStringLocalizer <Strings> localizer, IOptions <BotSettings> botOptions, IBotFrameworkHttpAdapter adapter, ITeamPreferenceStorageProvider teamPreferenceStorageProvider, IPostSearchService teamPostSearchService, IPostStorageHelper teamPostStorageHelper, ITeamTagStorageProvider teamTagStorageProvider, IOptions <GoodReadsActivityHandlerOptions> options) { this.logger = logger; this.localizer = localizer; this.botOptions = botOptions ?? throw new ArgumentNullException(nameof(botOptions)); this.adapter = adapter; this.teamPreferenceStorageProvider = teamPreferenceStorageProvider; this.teamPostSearchService = teamPostSearchService; this.teamTagStorageProvider = teamTagStorageProvider; this.teamPostStorageHelper = teamPostStorageHelper; this.options = options; this.retryPolicy = Policy.Handle <Exception>() .WaitAndRetryAsync(Backoff.DecorrelatedJitterBackoffV2(TimeSpan.FromMilliseconds(this.botOptions.Value.MedianFirstRetryDelay), this.botOptions.Value.RetryCount)); }