Simplified the configuration of sinks, sources, and HTTP clients by using direct actions instead of service-level options. Updated Apply method to finalize configurations and added notification handlers for better extensibility. Improved code readability and maintainability by consolidating logic and removing unnecessary dependencies.
20 lines
585 B
C#
20 lines
585 B
C#
using Elsa.Features.Services;
|
|
using Elsa.Webhooks.Features;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Elsa.Extensions;
|
|
|
|
/// <summary>
|
|
/// Adds extensions to <see cref="IModule"/> that enables the <see cref="WebhooksFeature"/> feature.
|
|
/// </summary>
|
|
public static class ModuleExtensions
|
|
{
|
|
/// <summary>
|
|
/// Enables and configures the <see cref="WebhooksFeature"/> feature.
|
|
/// </summary>
|
|
public static IModule UseWebhooks(this IModule module, Action<WebhooksFeature>? configure = null)
|
|
{
|
|
module.Configure(configure);
|
|
return module;
|
|
}
|
|
} |