ServiceCollectionExtensions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides extension methods for registering agent-related services, adapters, and middleware with dependency injection containers and application builders.
public static class ServiceCollectionExtensions
type ServiceCollectionExtensions = class
Public Module ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Remarks
These extension methods simplify the setup of agent applications by enabling the registration of agents, adapters, options, and supporting middleware. They are intended to be used during application startup to configure required services for agent-based architectures, such as those using CloudAdapter and AgentApplication. Methods in this class support both default and custom agent/adapters, and facilitate integration with ASP.NET Core's dependency injection and middleware pipelines.
Methods
| Name | Description |
|---|---|
| AddAgent(IHostApplicationBuilder, Func<IServiceProvider,IAgent>) |
Adds an Agent via lambda construction.
|
| AddAgent<TAdapter>(IHostApplicationBuilder, Func<IServiceProvider,IAgent>) |
This is the same as AddAgent(IHostApplicationBuilder, Func<IServiceProvider,IAgent>), except allows the
use of any |
| 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>(IHostApplicationBuilder) |
Same as AddAgent<TAgent>(IHostApplicationBuilder) but allows for use of
any
|
| AddAgent<TAgent,TAdapter>(IServiceCollection) |
Adds an agent and its associated cloud adapter to the service collection for dependency injection.
|
| AddAgent<TAgent>(IHostApplicationBuilder) |
Adds an Agent which subclasses
|
| AddAgentApplicationOptions(IHostApplicationBuilder, AutoSignInSelector) |
Registers AgentApplicationOptions for AgentApplication-based Agents. |
| AddAgentApplicationOptions(IServiceCollection, AutoSignInSelector, Boolean) |
Adds the required agent application options and, optionally, an auto sign-in selector to the service collection. |
| AddAgentCore(IHostApplicationBuilder) |
Adds the core agent services.
|
| AddAgentCore<TAdapter>(IHostApplicationBuilder) |
Adds the core agent services using a derived CloudAdapter.
|
| 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(IHostApplicationBuilder) |
Add the default CloudAdapter. |
| AddCloudAdapter(IServiceCollection) |
Add the default CloudAdapter. |
| AddCloudAdapter<T>(IHostApplicationBuilder) |
Add a derived CloudAdapter. |
| AddCloudAdapter<T>(IServiceCollection) |
Add a derived CloudAdapter. |
| UseHeaderPropagation(IApplicationBuilder) |
Adds a middleware that collects headers to be propagated. |