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
servicesIServiceCollectionThe IServiceCollection to register with.
implementationFactoryImplementationFactoryDelegateA 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
servicesIServiceCollectionThe IServiceCollection to register with.
implementationTypeTypeAn IHostedService to register.
Returns
- IServiceCollection
The original IServiceCollection.