< 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: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 40
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_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 />
 333214    public ManagementElsaDbContext(DbContextOptions<ManagementElsaDbContext> options, IServiceProvider serviceProvider) 
 15    {
 333216    }
 17
 18    /// <summary>
 19    /// The workflow definitions.
 20    /// </summary>
 333821    public DbSet<WorkflowDefinition> WorkflowDefinitions { get; set; } = null!;
 22
 23    /// <summary>
 24    /// The workflow instances.
 25    /// </summary>
 333426    public DbSet<WorkflowInstance> WorkflowInstances { get; set; } = null!;
 27
 28    /// <inheritdoc />
 29    protected override void OnModelCreating(ModelBuilder modelBuilder)
 30    {
 131        modelBuilder.Ignore<WorkflowState>();
 132        modelBuilder.Ignore<ActivityIncident>();
 33
 134        var config = new Configurations();
 135        modelBuilder.ApplyConfiguration<WorkflowDefinition>(config);
 136        modelBuilder.ApplyConfiguration<WorkflowInstance>(config);
 37
 138        base.OnModelCreating(modelBuilder);
 139    }
 40}