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
services
IServiceCollectionService container
task
IApplicationTaskTask 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
services
IServiceCollectionService container
factory
Func<IServiceProvider, IApplicationTask>A factory method to create an application task
lifetime
ServiceLifetimeTask 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
services
IServiceCollectionService container
name
stringWell known name of the task. This is how it's identified when called
runAction
Action<IServiceProvider>Task method body
lifetime
ServiceLifetimeTask 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
services
IServiceCollectionService container
lifetime
ServiceLifetimeTask lifetime
Type Parameters
T
Task implementation