/// <summary> /// Initializes a new instance of the <see cref="BotController"/> class. /// Dependency Injection will provide the Adapter and IBot implementation at runtime. /// </summary> /// <param name="adapter">Company Communicator Bot Adapter instance.</param> /// <param name="authorBot">Company Communicator Author Bot instance.</param> /// <param name="userBot">Company Communicator User Bot instance.</param> public BotController( CompanyCommunicatorBotAdapter adapter, AuthorTeamsActivityHandler authorBot, UserTeamsActivityHandler userBot) { this.adapter = adapter ?? throw new ArgumentNullException(nameof(adapter)); this.authorBot = authorBot ?? throw new ArgumentNullException(nameof(authorBot)); this.userBot = userBot ?? throw new ArgumentNullException(nameof(userBot)); }
/// <summary> /// Initializes a new instance of the <see cref="DraftNotificationPreviewService"/> class. /// </summary> /// <param name="configuration">Application configuration service.</param> /// <param name="adaptiveCardCreator">Adaptive card creator service.</param> /// <param name="companyCommunicatorBotAdapter">Bot framework http adapter instance.</param> public DraftNotificationPreviewService( IConfiguration configuration, AdaptiveCardCreator adaptiveCardCreator, CompanyCommunicatorBotAdapter companyCommunicatorBotAdapter) { this.botAppId = configuration["MicrosoftAppId"]; if (string.IsNullOrEmpty(this.botAppId)) { throw new ApplicationException("MicrosoftAppId setting is missing in the configuration."); } this.adaptiveCardCreator = adaptiveCardCreator; this.companyCommunicatorBotAdapter = companyCommunicatorBotAdapter; }
/// <summary> /// Initializes a new instance of the <see cref="DraftNotificationPreviewService"/> class. /// </summary> /// <param name="botOptions">The bot options.</param> /// <param name="adaptiveCardCreator">Adaptive card creator service.</param> /// <param name="companyCommunicatorBotAdapter">Bot framework http adapter instance.</param> public DraftNotificationPreviewService( IOptions <BotOptions> botOptions, AdaptiveCardCreator adaptiveCardCreator, CompanyCommunicatorBotAdapter companyCommunicatorBotAdapter) { var options = botOptions ?? throw new ArgumentNullException(nameof(botOptions)); this.botAppId = options.Value.AuthorAppId; if (string.IsNullOrEmpty(this.botAppId)) { throw new ApplicationException("AuthorAppId setting is missing in the configuration."); } this.adaptiveCardCreator = adaptiveCardCreator ?? throw new ArgumentNullException(nameof(adaptiveCardCreator)); this.companyCommunicatorBotAdapter = companyCommunicatorBotAdapter ?? throw new ArgumentNullException(nameof(companyCommunicatorBotAdapter)); }
/// <summary> /// Initializes a new instance of the <see cref="BotController"/> class. /// Dependency Injection will provide the Adapter and IBot implementation at runtime. /// </summary> /// <param name="adapter">Company Communicator Bot Adapter instance.</param> /// <param name="bot">Company Communicator Bot instance.</param> public BotController(CompanyCommunicatorBotAdapter adapter, IBot bot) { this.adapter = adapter; this.bot = bot; }