< Summary - Syki

Information
Class: Syki.Back.Configs.EfCoreConfigs
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Configs/EfCoreConfigs.cs
Tag: 56_26538939494
Line coverage
95%
Covered lines: 19
Uncovered lines: 1
Coverable lines: 20
Total lines: 36
Line coverage: 95%
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
AddEfCoreConfigs(...)100%1193.75%
UseEnrichDbContext(...)100%11100%
UseCommandsProcessorTrigger(...)100%11100%

File(s)

/home/runner/work/syki/syki/Back/Configs/EfCoreConfigs.cs

#LineLine coverage
 1using Npgsql;
 2
 3namespace Syki.Back.Configs;
 4
 5public static class EfCoreConfigs
 6{
 7    public static void AddEfCoreConfigs(this WebApplicationBuilder builder)
 8    {
 29        builder.Services.AddSingleton(sp =>
 210        {
 211            var dataSourceBuilder = new NpgsqlDataSourceBuilder(builder.Configuration.Database.ConnectionString);
 212
 213            dataSourceBuilder.ConfigureTracing(x =>
 214            {
 215                x.ConfigureCommandSpanNameProvider(provider =>
 216                {
 017                    return provider.CommandText.GetSqlSpanName();
 218                });
 419            });
 220
 221            return dataSourceBuilder.Build();
 222        });
 23
 224        builder.Services.AddDbContext<SykiDbContext>();
 225    }
 26
 27    public static void UseEnrichDbContext(this IApplicationBuilder app)
 28    {
 229        app.UseMiddleware<EnrichBackDbContextMiddleware>();
 230    }
 31
 32    public static void UseCommandsProcessorTrigger(this IApplicationBuilder app)
 33    {
 234        app.UseMiddleware<CommandsProcessorTriggerMiddleware>();
 235    }
 36}