< Summary

Information
Class: Elsa.Expressions.CSharp.ShellFeatures.CSharpFeature
Assembly: Elsa.Expressions.CSharp
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/ShellFeatures/CSharpFeature.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 46
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_CSharpOptions()100%210%
ConfigureServices(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/ShellFeatures/CSharpFeature.cs

#LineLine coverage
 1using CShells.Features;
 2using Elsa.Expressions.CSharp.Activities;
 3using Elsa.Expressions.CSharp.Contracts;
 4using Elsa.Expressions.CSharp.Options;
 5using Elsa.Expressions.CSharp.Providers;
 6using Elsa.Expressions.CSharp.Services;
 7using Elsa.Extensions;
 8using Elsa.Workflows;
 9using JetBrains.Annotations;
 10using Microsoft.Extensions.DependencyInjection;
 11
 12namespace Elsa.Expressions.CSharp.ShellFeatures;
 13
 14/// <summary>
 15/// Installs C# integration.
 16/// </summary>
 17[ShellFeature(
 18    DisplayName = "C# Expressions",
 19    Description = "Provides C# expression evaluation capabilities for workflows",
 20    DependsOn = ["Mediator", "Expressions", "MemoryCache"])]
 21[UsedImplicitly]
 22public class CSharpFeature : IShellFeature
 23{
 24    /// <summary>
 25    /// Configures the <see cref="CSharpOptions"/>.
 26    /// </summary>
 027    public Action<CSharpOptions> CSharpOptions { get; set; } = _ => { };
 28
 29    public void ConfigureServices(IServiceCollection services)
 30    {
 031        services.Configure(CSharpOptions);
 32
 33        // C# services.
 034        services
 035            .AddExpressionDescriptorProvider<CSharpExpressionDescriptorProvider>()
 036            .AddScoped<ICSharpEvaluator, CSharpEvaluator>();
 37
 38        // Handlers.
 039        services.AddNotificationHandlersFrom<CSharpFeature>();
 40
 41        // UI property handlers.
 042        services.AddScoped<IPropertyUIHandler, RunCSharpOptionsProvider>();
 043    }
 44}
 45
 46