< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Tenants.ConfigurationJsonConverter
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Tenants/ConfigurationJsonConverter.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 22
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%210%
SerializeConfiguration(...)0%620%
DeserializeConfiguration(...)0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Tenants/ConfigurationJsonConverter.cs

#LineLine coverage
 1using Elsa.Common.Serialization;
 2using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 3using Microsoft.Extensions.Configuration;
 4
 5namespace Elsa.Persistence.EFCore.Modules.Tenants;
 6
 07public class ConfigurationJsonConverter() : ValueConverter<IConfiguration, string>(
 08    config => SerializeConfiguration(config),
 09    json => DeserializeConfiguration(json))
 10{
 11    private static string SerializeConfiguration(IConfiguration configuration)
 12    {
 013        if (configuration == null) throw new ArgumentNullException(nameof(configuration));
 014        return Serializers.SerializeConfiguration(configuration);
 15    }
 16
 17    private static IConfiguration DeserializeConfiguration(string json)
 18    {
 019        if (json == null) throw new ArgumentNullException(nameof(json));
 020        return Serializers.DeserializeConfiguration(json);
 21    }
 22}