ServiceCollectionExtensions.AddBot 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| AddBot<TBot>(IServiceCollection, Action<BotFrameworkOptions>) |
在 中加入並可選擇配置 a |
| AddBot<TBot>(IServiceCollection, Func<IServiceProvider,TBot>, Action<BotFrameworkOptions>) |
在 中加入並可選擇配置 a |
| AddBot<TBot>(IServiceCollection, TBot, Action<BotFrameworkOptions>) |
新增並可選擇性地配置一個單例 |
AddBot<TBot>(IServiceCollection, Action<BotFrameworkOptions>)
在 中加入並可選擇配置 a TBot 到 IServiceCollection。
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddBot<TBot>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Bot.Builder.Integration.BotFrameworkOptions> configureAction = default) where TBot : class, Microsoft.Bot.Builder.IBot;
static member AddBot : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Bot.Builder.Integration.BotFrameworkOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Bot : null and 'Bot :> Microsoft.Bot.Builder.IBot)
<Extension()>
Public Function AddBot(Of TBot As {Class, IBot}) (services As IServiceCollection, Optional configureAction As Action(Of BotFrameworkOptions) = Nothing) As IServiceCollection
類型參數
- TBot
其中一種具體 IBot 的資訊會被註冊並暴露給機器人框架。
參數
- services
- IServiceCollection
- configureAction
- Action<BotFrameworkOptions>
若提供可選回調功能,將被呼叫以進一步設定機器人。
傳回
操作完成後,這裡是關於此實例的參考。
備註
該 S TBot 會被註冊為 暫時性 ,並在每回合被實例化。
另請參閱
適用於
AddBot<TBot>(IServiceCollection, Func<IServiceProvider,TBot>, Action<BotFrameworkOptions>)
在 中加入並可選擇配置 a TBot 到 IServiceCollection。
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddBot<TBot>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<IServiceProvider,TBot> botFactory, Action<Microsoft.Bot.Builder.Integration.BotFrameworkOptions> configureAction = default) where TBot : class, Microsoft.Bot.Builder.IBot;
static member AddBot : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, 'Bot (requires 'Bot : null and 'Bot :> Microsoft.Bot.Builder.IBot)> * Action<Microsoft.Bot.Builder.Integration.BotFrameworkOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Bot : null and 'Bot :> Microsoft.Bot.Builder.IBot)
<Extension()>
Public Function AddBot(Of TBot As {Class, IBot}) (services As IServiceCollection, botFactory As Func(Of IServiceProvider, TBot), Optional configureAction As Action(Of BotFrameworkOptions) = Nothing) As IServiceCollection
類型參數
- TBot
其中一種具體 IBot 的資訊會被註冊並暴露給機器人框架。
參數
- services
- IServiceCollection
- botFactory
- Func<IServiceProvider,TBot>
一個工廠方法,當被呼叫時會提供 的 TBot 實例。
- configureAction
- Action<BotFrameworkOptions>
若提供可選回調功能,將被呼叫以進一步設定機器人。
傳回
操作完成後,這裡是關於此實例的參考。
備註
這些指令 botFactory 會被登記為 暫時性 ,並在每回合被啟動。
另請參閱
適用於
AddBot<TBot>(IServiceCollection, TBot, Action<BotFrameworkOptions>)
新增並可選擇性地配置一個單例 bot 實例到 IServiceCollection。
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddBot<TBot>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, TBot bot, Action<Microsoft.Bot.Builder.Integration.BotFrameworkOptions> configureAction = default) where TBot : class, Microsoft.Bot.Builder.IBot;
static member AddBot : Microsoft.Extensions.DependencyInjection.IServiceCollection * 'Bot * Action<Microsoft.Bot.Builder.Integration.BotFrameworkOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Bot : null and 'Bot :> Microsoft.Bot.Builder.IBot)
<Extension()>
Public Function AddBot(Of TBot As {Class, IBot}) (services As IServiceCollection, bot As TBot, Optional configureAction As Action(Of BotFrameworkOptions) = Nothing) As IServiceCollection
類型參數
- TBot
其中一種具體 IBot 的資訊會被註冊並暴露給機器人框架。
參數
- services
- IServiceCollection
- bot
- TBot
將被註冊為 Singleton.
- configureAction
- Action<BotFrameworkOptions>
若提供可選回調功能,將被呼叫以進一步設定機器人。
傳回
操作完成後,這裡是關於此實例的參考。