< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Management.ManagementElsaDbContext
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Management/DbContext.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 46
Line coverage: 100%
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
.ctor(...)100%11100%
get_WorkflowDefinitions()100%11100%
get_WorkflowDefinitionRegistryGenerations()100%11100%
get_WorkflowInstances()100%11100%
OnModelCreating(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Management/DbContext.cs

#LineLine coverage
 1using Elsa.Workflows.Management.Entities;
 2using Elsa.Workflows.Models;
 3using Elsa.Workflows.State;
 4using Microsoft.EntityFrameworkCore;
 5
 6namespace Elsa.Persistence.EFCore.Modules.Management;
 7
 8/// <summary>
 9/// The database context for the Management module.
 10/// </summary>
 11public class ManagementElsaDbContext : ElsaDbContextBase
 12{
 13    /// <inheritdoc />
 1310314    public ManagementElsaDbContext(DbContextOptions<ManagementElsaDbContext> options, IServiceProvider serviceProvider) 
 15    {
 1310316    }
 17
 18    /// <summary>
 19    /// The workflow definitions.
 20    /// </summary>
 1311821    public DbSet<WorkflowDefinition> WorkflowDefinitions { get; set; } = null!;
 22
 23    /// <summary>
 24    /// Durable workflow-as-activity registry generations.
 25    /// </summary>
 1479326    public DbSet<WorkflowDefinitionRegistryGeneration> WorkflowDefinitionRegistryGenerations { get; set; } = null!;
 27
 28    /// <summary>
 29    /// The workflow instances.
 30    /// </summary>
 1322431    public DbSet<WorkflowInstance> WorkflowInstances { get; set; } = null!;
 32
 33    /// <inheritdoc />
 34    protected override void OnModelCreating(ModelBuilder modelBuilder)
 35    {
 536        modelBuilder.Ignore<WorkflowState>();
 537        modelBuilder.Ignore<ActivityIncident>();
 38
 539        var config = new Configurations();
 540        modelBuilder.ApplyConfiguration<WorkflowDefinition>(config);
 541        modelBuilder.ApplyConfiguration<WorkflowInstance>(config);
 542        modelBuilder.ApplyConfiguration<WorkflowDefinitionRegistryGeneration>(config);
 43
 544        base.OnModelCreating(modelBuilder);
 545    }
 46}