< Summary

Information
Class: Elsa.Workflows.Serialization.Configurators.AdditionalConvertersConfigurator
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Configurators/AdditionalConvertersConfigurator.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 22
Line coverage: 100%
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
.ctor(...)100%11100%
Configure(...)100%11100%
Create()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Configurators/AdditionalConvertersConfigurator.cs

#LineLine coverage
 1using System.Text.Json;
 2using System.Text.Json.Serialization;
 3using Elsa.Workflows.Serialization.Converters;
 4using JetBrains.Annotations;
 5using Microsoft.Extensions.DependencyInjection;
 6
 7namespace Elsa.Workflows.Serialization.Configurators;
 8
 9/// <summary>
 10/// Add additional <see cref="JsonConverter"/> objects.
 11/// </summary>
 12[UsedImplicitly]
 11413public class AdditionalConvertersConfigurator(IServiceProvider serviceProvider) : SerializationOptionsConfiguratorBase
 14{
 15    /// <inheritdoc />
 16    public override void Configure(JsonSerializerOptions options)
 17    {
 77118        options.Converters.Add(Create<VariableConverterFactory>());
 77119    }
 20
 77121    private T Create<T>() => ActivatorUtilities.CreateInstance<T>(serviceProvider);
 22}