Class ServiceProviderRegistrationExtensions
Provides developer-facing validation that required middleware services were registered.
Inherited Members
Namespace: Eigenverft.WebLib.Infrastructure.Hosting.Middleware.Infrastructure
Assembly: Eigenverft.WebLib.Infrastructure.dll
Syntax
public static class ServiceProviderRegistrationExtensions
Methods
| Edit this page View SourceEnsureServicesRegistered(IServiceProvider, string?, params Type[])
Ensures that all specified closed service types are available without activating those services.
Declaration
public static void EnsureServicesRegistered(this IServiceProvider serviceProvider, string? registrationHint, params Type[] requiredServiceTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | serviceProvider | The application service provider. |
| string | registrationHint | Optional guidance such as the matching |
| Type[] | requiredServiceTypes | Closed service types required by the middleware feature. |
EnsureServicesRegistered(IServiceProvider, params Type[])
Ensures that all specified closed service types are available without activating those services.
Declaration
public static void EnsureServicesRegistered(this IServiceProvider serviceProvider, params Type[] requiredServiceTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | serviceProvider | |
| Type[] | requiredServiceTypes |
EnsureServicesRegistered<TService>(IServiceProvider, string?)
Ensures that a single service is registered without activating it.
Declaration
public static void EnsureServicesRegistered<TService>(this IServiceProvider serviceProvider, string? registrationHint = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | serviceProvider | |
| string | registrationHint |
Type Parameters
| Name | Description |
|---|---|
| TService |