Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Extensions.​DependencyInjection.​ServiceCollectionHostedServiceExtensions
Assembly: Microsoft.Extensions.Hosting.Abstractions
Inheritance: object → ServiceCollectionHostedServiceExtensions
Extension methods for adding hosted services to an <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> .
Methods
public static
IServiceCollection
AddHostedService​(IServiceCollection services)
Add an <see cref="T:Microsoft.Extensions.Hosting.IHostedService" /> registration for the given type.
Returns The original <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> .
services
The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> to register with.
public static
IServiceCollection
AddHostedService​(IServiceCollection services,
System.​Func<​System.​IServiceProvider, THostedService> implementationFactory)
Add an <see cref="T:Microsoft.Extensions.Hosting.IHostedService" /> registration for the given type.
Returns The original <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> .
services
The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> to register with.
implementationFactory
A factory to create new instances of the service implementation.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object