Class ServiceCollectionHostedServiceExtensions
- Namespace
- Microsoft.Extensions.Hosting
- Assembly
- nanoFramework.Hosting.dll
Extensions for IServiceCollection.
public static class ServiceCollectionHostedServiceExtensions
- Inheritance
-
ServiceCollectionHostedServiceExtensions
- Inherited Members
Methods
AddHostedService(IServiceCollection, ImplementationFactoryDelegate)
Add an IHostedService registration for the given type.
public static IServiceCollection AddHostedService(this IServiceCollection services, ImplementationFactoryDelegate implementationFactory)
Parameters
services
IServiceCollectionThe IServiceCollection to register with.
implementationFactory
ImplementationFactoryDelegateA factory to create new instances of the service implementation.
Returns
- IServiceCollection
The original IServiceCollection.
AddHostedService(IServiceCollection, Type)
Add an IHostedService registration for the given type.
public static IServiceCollection AddHostedService(this IServiceCollection services, Type implementationType)
Parameters
services
IServiceCollectionThe IServiceCollection to register with.
implementationType
TypeAn IHostedService to register.
Returns
- IServiceCollection
The original IServiceCollection.