elsa-core/src/modules/Elsa.Expressions.CSharp/Extensions/ModuleExtensions.cs

29 lines
904 B
C#
Raw Normal View History

2025-05-20 11:52:19 +00:00
using Elsa.Expressions.CSharp.Features;
using Elsa.Expressions.CSharp.Options;
using Elsa.Features.Services;
// ReSharper disable once CheckNamespace
namespace Elsa.Extensions;
/// <summary>
/// Adds extensions to <see cref="IModule"/> that installs the <see cref="CSharpFeature"/> feature.
/// </summary>
public static class ModuleExtensions
{
/// <summary>
/// Setup the <see cref="CSharpFeature"/> feature.
/// </summary>
public static IModule UseCSharp(this IModule module, Action<CSharpFeature>? configure = default)
{
module.Configure(configure);
return module;
}
/// <summary>
/// Setup the <see cref="CSharpFeature"/> feature.
/// </summary>
public static IModule UseCSharp(this IModule module, Action<CSharpOptions> configureOptions)
{
return module.UseCSharp(csharp => csharp.CSharpOptions += configureOptions);
}
}