Class ServiceCollectionExtensions
Dependency injection extensions for
Inheritance
Namespace: X10D.Hosting.DependencyInjection
Assembly: X10D.Hosting.dll
Syntax
public static class ServiceCollectionExtensions : object
Methods
| Improve this Doc View SourceAddHostedSingleton(IServiceCollection, Type)
Adds an
Declaration
public static IServiceCollection AddHostedSingleton(this IServiceCollection services, Type type)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Type | type | The type of the service to register and the implementation to use. |
Returns
Type | Description |
---|---|
IServiceCollection | A reference to this instance after the operation has completed. |
AddHostedSingleton(IServiceCollection, Type, Type)
Adds an
Declaration
public static IServiceCollection AddHostedSingleton(this IServiceCollection services, Type serviceType, Type implementationType)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Type | serviceType | The type of the service to register. |
Type | implementationType | The type of the implementation to use. |
Returns
Type | Description |
---|---|
IServiceCollection | A reference to this instance after the operation has completed. |
AddHostedSingleton<TService>(IServiceCollection)
Adds an
Declaration
public static IServiceCollection AddHostedSingleton<TService>(this IServiceCollection services)
where TService : class, IHostedService
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Returns
Type | Description |
---|---|
IServiceCollection | A reference to this instance after the operation has completed. |
Type Parameters
Name | Description |
---|---|
TService | The type of the service to add. |
AddHostedSingleton<TService, TImplementation>(IServiceCollection)
Adds an
Declaration
public static IServiceCollection AddHostedSingleton<TService, TImplementation>(this IServiceCollection services)
where TService : class where TImplementation : class, TService, IHostedService
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Returns
Type | Description |
---|---|
IServiceCollection | A reference to this instance after the operation has completed. |
Type Parameters
Name | Description |
---|---|
TService | The type of the service to add. |
TImplementation | The type of the implementation to use. |