RoslynRules.EntityFrameworkCore 1.0.260721.1738

dotnet add package RoslynRules.EntityFrameworkCore --version 1.0.260721.1738
                    
NuGet\Install-Package RoslynRules.EntityFrameworkCore -Version 1.0.260721.1738
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RoslynRules.EntityFrameworkCore" Version="1.0.260721.1738" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RoslynRules.EntityFrameworkCore" Version="1.0.260721.1738" />
                    
Directory.Packages.props
<PackageReference Include="RoslynRules.EntityFrameworkCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RoslynRules.EntityFrameworkCore --version 1.0.260721.1738
                    
#r "nuget: RoslynRules.EntityFrameworkCore, 1.0.260721.1738"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RoslynRules.EntityFrameworkCore@1.0.260721.1738
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RoslynRules.EntityFrameworkCore&version=1.0.260721.1738
                    
Install as a Cake Addin
#tool nuget:?package=RoslynRules.EntityFrameworkCore&version=1.0.260721.1738
                    
Install as a Cake Tool

RoslynRules.EFCore

EF Core integration for RoslynRules. Provides entity mapping and lazy loading support while keeping the core Rule model sealed and immutable.

Problem

Rule is sealed to enforce immutability after compilation. This prevents EF Core lazy loading proxies from working (proxies require subclassing).

Solution

This package provides separate EF entities (RuleEntity, WorkflowEntity) that map to the same database schema. You use EF's entities for persistence and lazy loading, then convert to sealed domain models for execution.

Usage

1. Configure your DbContext

public class AppDbContext : DbContext
{
    public DbSet<WorkflowEntity> Workflows { get; set; } = null!;

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.ConfigureRoslynRules();
    }
}

2. Load with lazy loading, convert to domain model

// Lazy loading works — RuleEntity is NOT sealed
var entity = await db.Workflows.FirstAsync();

// Convert to sealed domain model
var workflow = entity.ToDomainModel();

// Compile and execute as usual
workflow.Compile(new[] { new RuleParameter("customer", typeof(Customer)) });
var results = workflow.Execute(new[] { new RuleParameter("customer", typeof(Customer), customer) });

Entity Mapping

Entity Property Domain Property Notes
Id Id Primary key
Description Description
DescriptionKey DescriptionKey Localization key
Expression Expression C# expression body
Action Action Assignment expression
IsActive IsActive
Priority Priority Execution order
Version Version SemVer (major.minor.patch)
Timeout Timeout Optional seconds
CacheDuration CacheDuration Optional seconds
DependsOnRuleId DependsOnRuleId Optional dependency
ParentRuleId ParentRuleId Optional parent
WorkflowId WorkflowId Optional workflow ref
ModifiedBy ModifiedBy Audit trail
CreatedAt CreatedAt Audit trail
ModifiedAt ModifiedAt Audit trail
ChildRules ChildRules Recursive collection

How It Works

Layer Type Sealed Lazy Loading
RuleEntity EF persistence No Yes
Rule Domain/execution Yes No

ToDomainModel() recursively converts the entity graph to sealed Rule instances, preserving all properties including versioning, timestamps, metadata, and child rules. Once converted, the domain model has full immutability and compilation safety.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.260721.1738 91 7/21/2026
1.0.260721.1532 87 7/21/2026
1.0.260615.1813 107 6/15/2026
1.0.260612.1729 109 6/12/2026
1.0.260609.2121 106 6/9/2026
1.0.260609.2113 106 6/9/2026
1.0.260607.2041 108 6/7/2026
1.0.260607.2032 105 6/7/2026
1.0.607.2014 100 6/7/2026
1.0.607.2009 100 6/7/2026
1.0.607.2001 103 6/7/2026
1.0.3 106 6/7/2026
1.0.2 102 6/4/2026
1.0.1 106 6/3/2026
1.0.0 100 6/3/2026