/// <summary>
 /// Initializes a new instance of the <see cref="MatchingService"/> class.
 /// </summary>
 /// <param name="dataProvider">The data provider to use</param>
 /// <param name="conversationHelper">Conversation helper instance to notify team members</param>
 /// <param name="telemetryClient">The telemetry client to use</param>
 /// <param name="botAdapter">Bot adapter.</param>
 public MatchingService(IBotDataProvider dataProvider, ConversationHelper conversationHelper, TelemetryClient telemetryClient, BotAdapter botAdapter)
 {
     this.dataProvider       = dataProvider;
     this.conversationHelper = conversationHelper;
     this.telemetryClient    = telemetryClient;
     this.botAdapter         = botAdapter;
     this.maxPairUpsPerTeam  = Convert.ToInt32(CloudConfigurationManager.GetSetting("MaxPairUpsPerTeam"));
     this.botDisplayName     = CloudConfigurationManager.GetSetting("BotDisplayName");
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IcebreakerBot"/> class.
        /// </summary>
        /// <param name="dataProvider">The data provider to use</param>
        /// <param name="conversationHelper">Conversation helper instance to notify team members</param>
        /// <param name="appCredentials">Microsoft app credentials to use.</param>
        /// <param name="telemetryClient">The telemetry client to use</param>
        public IcebreakerBot(IBotDataProvider dataProvider, ConversationHelper conversationHelper, MicrosoftAppCredentials appCredentials, TelemetryClient telemetryClient)
        {
            this.dataProvider        = dataProvider;
            this.conversationHelper  = conversationHelper;
            this.appCredentials      = appCredentials;
            this.telemetryClient     = telemetryClient;
            this.botDisplayName      = CloudConfigurationManager.GetSetting("BotDisplayName");
            this.disableTenantFilter = Convert.ToBoolean(CloudConfigurationManager.GetSetting("DisableTenantFilter"), CultureInfo.InvariantCulture);
            var allowedTenants = CloudConfigurationManager.GetSetting("AllowedTenants");

            this.allowedTenantIds = allowedTenants
                                    ?.Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries)
                                    ?.Select(p => p.Trim())
                                    .ToHashSet();
        }