2022-11-20 19:37:56 +00:00
|
|
|
using Elsa.Features.Services;
|
|
|
|
|
using Elsa.Quartz.Features;
|
2024-07-18 16:57:42 +00:00
|
|
|
using Elsa.Scheduling;
|
2023-04-11 18:17:15 +00:00
|
|
|
using Elsa.Scheduling.Features;
|
2022-11-20 19:37:56 +00:00
|
|
|
|
2022-12-31 15:16:43 +00:00
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
|
namespace Elsa.Extensions;
|
2022-11-20 19:37:56 +00:00
|
|
|
|
2023-04-11 18:17:15 +00:00
|
|
|
/// <summary>
|
2023-04-12 13:10:44 +00:00
|
|
|
/// Provides extension methods for the <see cref="SchedulingFeature"/>.
|
2023-04-11 18:17:15 +00:00
|
|
|
/// </summary>
|
2022-11-20 19:37:56 +00:00
|
|
|
public static class ModuleExtensions
|
|
|
|
|
{
|
2023-04-11 18:17:15 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Installs and configures Quartz.NET. Only use this feature if you are not configuring Quartz.NET yourself.
|
|
|
|
|
/// </summary>
|
2022-11-20 19:37:56 +00:00
|
|
|
public static IModule UseQuartz(this IModule module, Action<QuartzFeature>? configure = default)
|
|
|
|
|
{
|
2023-04-11 18:17:15 +00:00
|
|
|
return module.Use(configure);
|
|
|
|
|
}
|
2024-07-18 16:57:42 +00:00
|
|
|
|
2023-04-11 18:17:15 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Installs a Quartz.NET implementation for <see cref="IWorkflowScheduler"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static SchedulingFeature UseQuartzScheduler(this SchedulingFeature feature, Action<QuartzSchedulerFeature>? configure = default)
|
|
|
|
|
{
|
|
|
|
|
feature.Module.Use(configure);
|
|
|
|
|
return feature;
|
2022-11-20 19:37:56 +00:00
|
|
|
}
|
|
|
|
|
}
|