Sprog

ServiceCollectionExtensions.AddAgentCore Method

Definition

Overloads

Name Description
AddAgentCore<TAdapter>(IServiceCollection)

Adds core services required for Agent functionality, including the specified cloud adapter, to the application's dependency injection container.

AddAgentCore<TAdapter>(IServiceCollection, String, String)

Adds core services required for Agent functionality, including the specified cloud adapter, to the application's dependency injection container, using custom configuration section paths for connections and the connections map.

AddAgentCore<TAdapter>(IServiceCollection)

Adds core services required for Agent functionality, including the specified cloud adapter, to the application's dependency injection container.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAgentCore<TAdapter>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TAdapter : Microsoft.Agents.Hosting.AspNetCore.CloudAdapter;
static member AddAgentCore : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Adapter :> Microsoft.Agents.Hosting.AspNetCore.CloudAdapter)
<Extension()>
Public Function AddAgentCore(Of TAdapter As CloudAdapter) (services As IServiceCollection) As IServiceCollection

Type Parameters

TAdapter

The type of cloud adapter to register. Must inherit from CloudAdapter.

Parameters

services
IServiceCollection

The service collection to which the agent core services will be added.

Returns

Remarks

This method registers essential services such as IConnections and IChannelServiceClientFactory if they are not already present. It also adds the specified CloudAdapter implementation, enabling integration with Azure Bot Service and Activity Protocol Agents.

Applies to

AddAgentCore<TAdapter>(IServiceCollection, String, String)

Adds core services required for Agent functionality, including the specified cloud adapter, to the application's dependency injection container, using custom configuration section paths for connections and the connections map.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAgentCore<TAdapter>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string connectionsKey, string mapKey) where TAdapter : Microsoft.Agents.Hosting.AspNetCore.CloudAdapter;
static member AddAgentCore : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Adapter :> Microsoft.Agents.Hosting.AspNetCore.CloudAdapter)
<Extension()>
Public Function AddAgentCore(Of TAdapter As CloudAdapter) (services As IServiceCollection, connectionsKey As String, mapKey As String) As IServiceCollection

Type Parameters

TAdapter

The type of cloud adapter to register. Must inherit from CloudAdapter.

Parameters

services
IServiceCollection

The service collection to which the agent core services will be added.

connectionsKey
String

The configuration section path containing connection definitions.

mapKey
String

The configuration section path containing the connections map.

Returns

The same service collection to allow for method chaining.

Remarks

This method does not replace an existing IConnections registration. Call it before other agent registration methods when custom configuration section paths are required.

Applies to