Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationBackgroundService"/> class.
 /// BackgroundService class that inherits IHostedService and implements the methods related to sending notification tasks.
 /// </summary>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 /// <param name="notificationHelper">Helper to send notification in channel.</param>
 /// <param name="backgroundTaskWrapper">Wrapper class instance for BackgroundTask.</param>
 public NotificationBackgroundService(ILogger <NotificationBackgroundService> logger, INotificationHelper notificationHelper, BackgroundTaskWrapper backgroundTaskWrapper)
 {
     this.logger                = logger;
     this.expression            = CronExpression.Parse("0 10,17 * * *");
     this.timeZoneInfo          = TimeZoneInfo.Utc;
     this.notificationHelper    = notificationHelper;
     this.backgroundTaskWrapper = backgroundTaskWrapper;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChannelHelper"/> class.
 /// </summary>
 /// <param name="microsoftAppCredentials">App Credentials.</param>
 /// <param name="optionsAccessor">A set of key/value application configuration properties for Group activities bot.</param>
 /// <param name="groupActivityStorageHelper">Helper for storing group activity details in azure table storage.</param>
 /// <param name="graphApiHelper">Helper for accessing Microsoft Graph API.</param>
 /// <param name="groupNotificationStorageHelper">Helper for sending notification in channel.</param>
 /// <param name="backgroundTaskWrapper">Instance for background task wrapper.</param>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 public ChannelHelper(ILogger <ChannelHelper> logger, IOptionsMonitor <BotAppSetting> optionsAccessor, IGroupNotificationStorageHelper groupNotificationStorageHelper, IGroupActivityStorageHelper groupActivityStorageHelper, IGraphApiHelper graphApiHelper, MicrosoftAppCredentials microsoftAppCredentials, BackgroundTaskWrapper backgroundTaskWrapper)
 {
     this.options        = optionsAccessor.CurrentValue;
     this.graphApiHelper = graphApiHelper;
     this.logger         = logger;
     this.groupNotificationStorageHelper = groupNotificationStorageHelper;
     this.groupActivityStorageHelper     = groupActivityStorageHelper;
     this.tenantId = this.options.TenantId;
     this.microsoftAppCredentials = microsoftAppCredentials;
     this.taskWrapper             = backgroundTaskWrapper;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundService"/> class.
 /// </summary>
 /// <param name="taskWrapper">Wrapper class instance for BackgroundTask.</param>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 public BackgroundService(BackgroundTaskWrapper taskWrapper, ILogger <BackgroundService> logger)
 {
     this.taskWrapper = taskWrapper;
     this.logger      = logger;
 }