Table of Contents

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 IServiceCollection

The IServiceCollection to register with.

implementationType Type

The implementation type of the service.

Returns

IServiceCollection

The original IServiceCollection.

Exceptions

ArgumentNullException

services or implementationType can't be null

ArgumentException

Implementation type must inherit IHostedService interface.