< Summary

Information
Class: Elsa.Persistence.EFCore.Extensions.PropertyBuilderExtensions
Assembly: Elsa.Persistence.EFCore.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.Common/Extensions/PropertyBuilderExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 21
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
HasJsonValueConversion(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.Common/Extensions/PropertyBuilderExtensions.cs

#LineLine coverage
 1using Elsa.Persistence.EFCore.Converters;
 2using Microsoft.EntityFrameworkCore.Metadata.Builders;
 3
 4namespace Elsa.Persistence.EFCore.Extensions;
 5
 6public static class PropertyBuilderExtensions {
 7
 8    /// <summary>
 9    /// Serializes field as JSON blob in database.
 10    /// </summary>
 11    public static PropertyBuilder<T> HasJsonValueConversion<T>(this PropertyBuilder<T> propertyBuilder) where T : class 
 12
 013        propertyBuilder
 014            .HasConversion(new JsonValueConverter<T>())
 015            .Metadata.SetValueComparer(new JsonValueComparer<T>());
 16
 017        return propertyBuilder;
 18
 19    }
 20
 21}