< Summary

Information
Class: Elsa.Persistence.EFCore.ElsaDbContextOptionsExtensions
Assembly: Elsa.Persistence.EFCore.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.Common/ElsaDbContextOptionsExtensions.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 28
Line coverage: 100%
Branch coverage
75%
Covered branches: 9
Total branches: 12
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UseElsaDbContextOptions(...)100%11100%
GetMigrationsAssemblyName(...)75%44100%
GetMigrationsHistoryTableName(...)75%44100%
GetSchemaName(...)75%44100%

File(s)

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

#LineLine coverage
 1using System.Reflection;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Infrastructure;
 4using Microsoft.EntityFrameworkCore.Migrations;
 5
 6namespace Elsa.Persistence.EFCore;
 7
 8/// <summary>
 9/// Provides options for configuring Elsa's Entity Framework Core integration.
 10/// </summary>
 11public static class ElsaDbContextOptionsExtensions
 12{
 13    /// <summary>
 14    /// Installs a custom extension for Elsa's Entity Framework Core integration.
 15    /// </summary>
 16    /// <param name="optionsBuilder">The options builder to install the extension on.</param>
 17    /// <param name="options">The options to install.</param>
 18    public static DbContextOptionsBuilder UseElsaDbContextOptions(this DbContextOptionsBuilder optionsBuilder, ElsaDbCon
 19    {
 165320        ((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(new ElsaDbContextOptionsExtension(
 165321        optionsBuilder.ReplaceService<IMigrationsAssembly, DbSchemaAwareMigrationAssembly>();
 165322        return optionsBuilder;
 23    }
 24
 165325    public static string GetMigrationsAssemblyName(this ElsaDbContextOptions? options, Assembly migrationsAssembly) => o
 165326    public static string GetMigrationsHistoryTableName(this ElsaDbContextOptions? options) => options?.MigrationsHistory
 165327    public static string GetSchemaName(this ElsaDbContextOptions? options) => options?.SchemaName ?? ElsaDbContextBase.E
 28}