Udostępnij przez


ServiceCollectionExtensions Class

Definition

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

Methods

AddAgent(IHostApplicationBuilder, Func<IServiceProvider,IAgent>)

Adds an Agent via lambda construction.

builder.Services.AddSingleton<IStorage, MemoryStorage>();
builder.AddAgentApplicationOptions();
builder.AddAgent(sp =>
{
   var options = new AgentApplicationOptions()
   {
      TurnStateFactory = () => new TurnState(sp.GetService<IStorage>());
   };

   var app = new AgentApplication(options);

   ...

   return app;
});
AddAgent<TAdapter>(IHostApplicationBuilder, Func<IServiceProvider,IAgent>)

This is the same as AddAgent(IHostApplicationBuilder, Func<IServiceProvider,IAgent>), except allows the use of any CloudAdapter subclass.

AddAgent<TAgent,TAdapter>(IHostApplicationBuilder)

Same as AddAgent<TAgent>(IHostApplicationBuilder) but allows for use of any CloudAdapter subclass.

AddAgent<TAgent>(IHostApplicationBuilder)

Adds an Agent which subclasses AgentApplication

builder.Services.AddSingleton<IStorage, MemoryStorage>();
builder.AddAgentApplicationOptions();
builder.AddAgent<MyAgent>();
AddAgentApplicationOptions(IHostApplicationBuilder, AutoSignInSelector)

Registers AgentApplicationOptions for AgentApplication-based Agents.

AddAgentCore(IHostApplicationBuilder)

Adds the core agent services.

AddAgentCore<TAdapter>(IHostApplicationBuilder)
AddCloudAdapter(IServiceCollection)

Add the default CloudAdapter.

AddCloudAdapter<T>(IServiceCollection)

Add a derived CloudAdapter.

UseHeaderPropagation(IApplicationBuilder)

Adds a middleware that collects headers to be propagated.

Applies to