< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Tenants.Configurations
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Tenants/Configurations.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 19
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
Configure(...)100%210%

File(s)

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

#LineLine coverage
 1using Elsa.Common.Multitenancy;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace Elsa.Persistence.EFCore.Modules.Tenants;
 6
 7/// <summary>
 8/// EF Core configuration for <see cref="Tenant"/>.
 9/// </summary>
 10public class Configurations : IEntityTypeConfiguration<Tenant>
 11{
 12    public void Configure(EntityTypeBuilder<Tenant> builder)
 13    {
 014        builder.Property(x => x.Name).IsRequired();
 015        builder.Property(x => x.Configuration).HasConversion<ConfigurationJsonConverter>();
 016        builder.HasIndex(x => x.Name).HasDatabaseName($"IX_{nameof(Tenant)}_{nameof(Tenant.Name)}");
 017        builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(Tenant)}_{nameof(Tenant.TenantId)}");
 018    }
 19}