src/Futurum.Microsoft.Extensions.DependencyInjection/Startable.cs
/// <summary>
/// Adds a <see cref="IStartable"/>
/// <remarks>A startable is resolved at the start of the application lifecycle and is a place to perform actions as soon as the DependencyInjection container is built.</remarks>
/// </summary>
Adds a A startable is resolved at the start of the application lifecycle and is a place to perform actions as soon as the DependencyInjection container is built.
Adds a A startable is resolved at the start of the application lifecycle and is a place to perform actions as soon as the DependencyInjection container is built .
public static IServiceCollection AddStartable<T>(this IServiceCollection services, T startable)
        where T : class, IStartable
    {
        services.AddSingleton<IStartable>(startable);
        services.TryAddSingleton<IHostedService, StartableHostedService>();
        return services;
    }
public static IServiceCollection AddStartable < T > ( this IServiceCollection services , T startable ) where T : class , IStartable { services . AddSingleton < IStartable > ( startable ) ; services . TryAddSingleton < IHostedService , StartableHostedService > ( ) ; return services ; }
Adds a A startable is resolved at the start of the application lifecycle and is a place to perform actions as soon as the DependencyInjection container is built.
Adds a A startable is resolved at the start of the application lifecycle and is a place to perform actions as soon as the DependencyInjection container is built .
IServiceCollection
this
startable
T