Class TaskServiceCollectionExtensions
- Namespace
- Steeltoe.Management.TaskCore
- Assembly
- Steeltoe.Management.TaskCore.dll
public static class TaskServiceCollectionExtensions
- Inheritance
-
TaskServiceCollectionExtensions
- Inherited Members
Methods
AddTask(IServiceCollection, IApplicationTask)
Register a one-off task that can be executed from command line
public static void AddTask(this IServiceCollection services, IApplicationTask task)
Parameters
servicesIServiceCollectionService container
taskIApplicationTaskTask instance
AddTask(IServiceCollection, Func<IServiceProvider, IApplicationTask>, ServiceLifetime)
Register a one-off task that can be executed from command line
public static void AddTask(this IServiceCollection services, Func<IServiceProvider, IApplicationTask> factory, ServiceLifetime lifetime = ServiceLifetime.Singleton)
Parameters
servicesIServiceCollectionService container
factoryFunc<IServiceProvider, IApplicationTask>A factory method to create an application task
lifetimeServiceLifetimeTask lifetime
AddTask(IServiceCollection, string, Action<IServiceProvider>, ServiceLifetime)
Register a one-off task that can be executed from command line
public static void AddTask(this IServiceCollection services, string name, Action<IServiceProvider> runAction, ServiceLifetime lifetime = ServiceLifetime.Singleton)
Parameters
servicesIServiceCollectionService container
namestringWell known name of the task. This is how it's identified when called
runActionAction<IServiceProvider>Task method body
lifetimeServiceLifetimeTask lifetime
AddTask<T>(IServiceCollection, ServiceLifetime)
Register a one-off task that can be executed from command line
public static void AddTask<T>(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Singleton) where T : class, IApplicationTask
Parameters
servicesIServiceCollectionService container
lifetimeServiceLifetimeTask lifetime
Type Parameters
TTask implementation