ServiceCollectionExtensions.AddBot 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddBot<TBot>(IServiceCollection, Action<BotFrameworkOptions>)
添加 并选择性地配置 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
要注册并公开给 Bot Framework 的具体类型的 IBot 。
参数
- services
- IServiceCollection
- configureAction
- Action<BotFrameworkOptions>
可选的回调(如果提供)将调用以进一步配置机器人。
返回
完成操作后对此实例的引用。
注解
TBot
将注册为暂时性,并在每个轮次实例化。
另请参阅
适用于
AddBot<TBot>(IServiceCollection, Func<IServiceProvider,TBot>, Action<BotFrameworkOptions>)
添加 并选择性地配置 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
要注册并公开给 Bot Framework 的具体类型的 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
要注册并公开给 Bot Framework 的具体类型的 IBot 。
参数
- services
- IServiceCollection
- bot
- TBot
将注册为 Singleton的机器人实例。
- configureAction
- Action<BotFrameworkOptions>
可选的回调(如果提供)将调用以进一步配置机器人。
返回
完成操作后对此实例的引用。