Class ServiceCollectionHostedServiceExtensions
- Namespace
- nanoFramework.Hosting
- Assembly
- nanoFramework.Hosting.dll
Extensions for IServiceCollection.
public static class ServiceCollectionHostedServiceExtensions
- Inheritance
-
ServiceCollectionHostedServiceExtensions
- Inherited Members
Methods
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.
implementationTypeTypeThe implementation type of the service.
Returns
- IServiceCollection
The original IServiceCollection.
Exceptions
- ArgumentNullException
servicesorimplementationTypecan't be null- ArgumentException
Implementation type must inherit IHostedService interface.