Lingua

ServiceCollectionExtensions Class

Definition

Provides extension methods for registering agent-related services, adapters, and middleware with dependency injection containers.

public static class ServiceCollectionExtensions
type ServiceCollectionExtensions = class
Public Module ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions

Remarks

These extension methods operate on IServiceCollection (and IHostApplicationBuilder.Services) to register agents, adapters, options, and supporting services during application startup, such as those using CloudAdapter and AgentApplication. The application-builder and request-pipeline APIs (fluent startup, middleware ordering, and endpoint mapping) live in AgentHostExtensions.

Methods

Name Description
AddAgent<TAdapter>(IServiceCollection, Func<IServiceProvider,IAgent>)

Adds an agent and its associated adapter to the service collection using the specified implementation factory.

AddAgent<TAgent,TAdapter>(IServiceCollection)

Adds an agent and its associated cloud adapter to the service collection for dependency injection.

services.AddSingleton<IStorage, MemoryStorage>();
services.AddAgent<MyAgent, CloudAdapter>();
AddAgentApplicationOptions(IServiceCollection, AutoSignInSelector, Boolean)

Adds the required agent application options and, optionally, an auto sign-in selector to the service collection.

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.

AddAsyncAdapterSupport(IServiceCollection)

Adds background task and activity processing support to the specified service collection, enabling asynchronous task execution via hosted services and task queues.

AddCloudAdapter(IServiceCollection)

Add the default CloudAdapter.

AddCloudAdapter<T>(IServiceCollection)

Add a derived CloudAdapter.

Applies to