elsa-core/src/modules/Elsa.Workflows.Management/Extensions/ModuleExtensions.cs

25 lines
768 B
C#
Raw Normal View History

using Elsa.Features.Services;
2022-06-29 13:36:27 +00:00
using Elsa.Workflows.Core.Activities;
using Elsa.Workflows.Management.Features;
// ReSharper disable once CheckNamespace
namespace Elsa.Extensions;
/// <summary>
/// Provides extensions to the specified <see cref="IModule"/>/
/// </summary>
public static class ModuleExtensions
{
/// <summary>
/// Adds the workflow management feature to the specified module.
/// </summary>
public static IModule UseWorkflowManagement(this IModule module, Action<WorkflowManagementFeature>? configure = default)
{
2022-06-29 13:36:27 +00:00
module.Configure<WorkflowManagementFeature>(management =>
{
management.AddActivity<NotFoundActivity>();
configure?.Invoke(management);
});
return module;
}
}