< Summary

Information
Class: Elsa.Workflows.Serialization.Converters.JsonIgnoreCompositeRootConverter
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Converters/JsonIgnoreCompositeRootConverter.cs
Line coverage
75%
Covered lines: 3
Uncovered lines: 1
Coverable lines: 4
Total lines: 27
Line coverage: 75%
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%
Read(...)100%210%
Write(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Converters/JsonIgnoreCompositeRootConverter.cs

#LineLine coverage
 1using System.Diagnostics.CodeAnalysis;
 2using System.Reflection;
 3using System.Text.Json;
 4using System.Text.Json.Serialization;
 5using Elsa.Workflows.Attributes;
 6using Elsa.Workflows.Serialization.Helpers;
 7
 8namespace Elsa.Workflows.Serialization.Converters;
 9
 10/// <summary>
 11/// Ignores properties with the <see cref="JsonIgnoreCompositeRootAttribute"/> attribute.
 12/// </summary>
 127213public class JsonIgnoreCompositeRootConverter(ActivityWriter activityWriter) : JsonConverter<IActivity>
 14{
 15    /// <inheritdoc />
 16    public override IActivity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 17    {
 018        throw new NotImplementedException();
 19    }
 20
 21    /// <inheritdoc />
 22    [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require
 23    public override void Write(Utf8JsonWriter writer, IActivity? value, JsonSerializerOptions options)
 24    {
 1293225        activityWriter.WriteActivity(writer, value, options, ignoreSpecializedConverters: true, propertyFilter: property
 118426    }
 27}