Skip to main content

Definition

Assembly: Microsoft.Extensions.DependencyInjection.Abstractions.dll Namespace: Microsoft.Extensions.DependencyInjection

Syntax

Summary

This type is defined in Microsoft.Extensions.DependencyInjection.Abstractions.

Remarks

See Microsoft documentation for more information about the rest of the API.

Methods

AddConfigurationBase Extension

Extension method from Microsoft.Extensions.DependencyInjection.EasyAF_Configuration_IServiceCollectionExtensions
Adds a configuration class that inherits from ConfigurationBase to the service collection. The configuration is bound from the specified configuration section and registered as both the specific type and the base ConfigurationBase type for dependency injection.

Syntax

Parameters

Returns

Type: TConfiguration The bound configuration instance for immediate use or further configuration.

Type Parameters

  • TConfiguration - The type of configuration class that inherits from ConfigurationBase.

Examples

AddHttpClients Extension

Extension method from Microsoft.Extensions.DependencyInjection.EasyAF_Http_IServiceCollectionExtensions
Adds HTTP clients to the service collection based on configuration properties marked with HttpEndpointAttribute. Uses the default HttpHandlerMode from the configuration.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for method chaining.

Type Parameters

  • TConfig - The configuration type that contains HTTP endpoint definitions.
  • TMessageHandler - The type of message handler to add to the HTTP clients.

AddHttpClients Extension

Extension method from Microsoft.Extensions.DependencyInjection.EasyAF_Http_IServiceCollectionExtensions
Adds HTTP clients to the service collection based on configuration properties marked with HttpEndpointAttribute. Allows explicit specification of the HttpHandlerMode for message handler configuration.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for method chaining.

Type Parameters

  • TConfig - The configuration type that contains HTTP endpoint definitions.
  • TMessageHandler - The type of message handler to add to the HTTP clients.

Examples