< Summary

Information
Class: Elsa.Persistence.EFCore.Extensions.DbContextOptionsBuilderExtensions
Assembly: Elsa.Persistence.EFCore.PostgreSql
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/DbContextOptionsBuilder.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 28
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UseElsaPostgreSql(...)50%22100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.PostgreSql/DbContextOptionsBuilder.cs

#LineLine coverage
 1using System.Reflection;
 2using Microsoft.EntityFrameworkCore;
 3using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Elsa.Persistence.EFCore.Extensions;
 7
 8/// <summary>
 9/// Contains extension methods for <see cref="DbContextOptionsBuilder"/>.
 10/// </summary>
 11public static class DbContextOptionsBuilderExtensions
 12{
 13    /// <summary>
 14    /// Configures Entity Framework Core with PostgreSQL.
 15    /// </summary>
 16    public static DbContextOptionsBuilder UseElsaPostgreSql(this DbContextOptionsBuilder builder, Assembly migrationsAss
 165317        builder
 165318            .UseElsaDbContextOptions(options)
 165319            .UseNpgsql(connectionString, db =>
 165320            {
 165321                db
 165322                    .MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly))
 165323                    .MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName());
 165324
 165325                configure?.Invoke(db);
 165326            });
 27
 28}