RoslynRules.EntityFrameworkCore
1.0.2
See the version list below for details.
dotnet add package RoslynRules.EntityFrameworkCore --version 1.0.2
NuGet\Install-Package RoslynRules.EntityFrameworkCore -Version 1.0.2
<PackageReference Include="RoslynRules.EntityFrameworkCore" Version="1.0.2" />
<PackageVersion Include="RoslynRules.EntityFrameworkCore" Version="1.0.2" />
<PackageReference Include="RoslynRules.EntityFrameworkCore" />
paket add RoslynRules.EntityFrameworkCore --version 1.0.2
#r "nuget: RoslynRules.EntityFrameworkCore, 1.0.2"
#:package RoslynRules.EntityFrameworkCore@1.0.2
#addin nuget:?package=RoslynRules.EntityFrameworkCore&version=1.0.2
#tool nuget:?package=RoslynRules.EntityFrameworkCore&version=1.0.2
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) });
How It Works
| Layer | Type | Sealed | Lazy Loading |
|---|---|---|---|
RuleEntity |
EF persistence | No | Yes |
Rule |
Domain/execution | Yes | No |
The ToDomainModel() method recursively converts the entity graph to sealed Rule instances. Once converted, the domain model has full immutability and compilation safety.
| Product | Versions 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. |
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.11)
- RoslynRules (>= 1.0.5)
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.260607.2041 | 0 | 6/7/2026 |
| 1.0.260607.2032 | 0 | 6/7/2026 |
| 1.0.607.2014 | 0 | 6/7/2026 |
| 1.0.607.2009 | 0 | 6/7/2026 |
| 1.0.607.2001 | 0 | 6/7/2026 |
| 1.0.3 | 0 | 6/7/2026 |
| 1.0.2 | 41 | 6/4/2026 |
| 1.0.1 | 39 | 6/3/2026 |
| 1.0.0 | 41 | 6/3/2026 |