Table of Contents

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 IServiceCollection

The IServiceCollection to register with.

implementationFactory ImplementationFactoryDelegate

A 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 IServiceCollection

The IServiceCollection to register with.

implementationType Type

An IHostedService to register.

Returns

IServiceCollection

The original IServiceCollection.