ServiceCollectionExtensions.AddBot Method

Definition

Overloads

AddBot<TBot>(IServiceCollection, Action<BotFrameworkOptions>)

Adds and optionally configures a TBot to the IServiceCollection.

AddBot<TBot>(IServiceCollection, Func<IServiceProvider,TBot>, Action<BotFrameworkOptions>)

Adds and optionally configures a TBot to the IServiceCollection.

AddBot<TBot>(IServiceCollection, TBot, Action<BotFrameworkOptions>)

Adds and optionally configures a singleton bot instance to the IServiceCollection.

AddBot<TBot>(IServiceCollection, Action<BotFrameworkOptions>)

Adds and optionally configures a TBot to the 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

Type Parameters

TBot

A concrete type of IBot that is to be registered and exposed to the Bot Framework.

Parameters

configureAction
Action<BotFrameworkOptions>

A optional callback that, if provided, will be invoked to further configure of the bot.

Returns

A reference to this instance after the operation has completed.

Remarks

The TBot will be registered as transient and be instantiated on each turn.

See also

Applies to

AddBot<TBot>(IServiceCollection, Func<IServiceProvider,TBot>, Action<BotFrameworkOptions>)

Adds and optionally configures a TBot to the 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

Type Parameters

TBot

A concrete type of IBot that is to be registered and exposed to the Bot Framework.

Parameters

botFactory
Func<IServiceProvider,TBot>

A factory method that will supply an instance of the TBot when invoked.

configureAction
Action<BotFrameworkOptions>

A optional callback that, if provided, will be invoked to further configure of the bot.

Returns

A reference to this instance after the operation has completed.

Remarks

The botFactory will be registered as transient and be invoked on each turn.

See also

Applies to

AddBot<TBot>(IServiceCollection, TBot, Action<BotFrameworkOptions>)

Adds and optionally configures a singleton bot instance to the 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

Type Parameters

TBot

A concrete type of IBot that is to be registered and exposed to the Bot Framework.

Parameters

bot
TBot

The instance of the bot that will be registered as a Singleton.

configureAction
Action<BotFrameworkOptions>

A optional callback that, if provided, will be invoked to further configure of the bot.

Returns

A reference to this instance after the operation has completed.

See also

Applies to