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
services
IServiceCollectionThe IServiceCollection to register with.
implementationType
TypeThe implementation type of the service.
Returns
- IServiceCollection
The original IServiceCollection.
Exceptions
- ArgumentNullException
services
orimplementationType
can't be null- ArgumentException
Implementation type must inherit IHostedService interface.