Muonroi.RuleEngine.Core
2.0.2
dotnet add package Muonroi.RuleEngine.Core --version 2.0.2
NuGet\Install-Package Muonroi.RuleEngine.Core -Version 2.0.2
<PackageReference Include="Muonroi.RuleEngine.Core" Version="2.0.2" />
<PackageVersion Include="Muonroi.RuleEngine.Core" Version="2.0.2" />
<PackageReference Include="Muonroi.RuleEngine.Core" />
paket add Muonroi.RuleEngine.Core --version 2.0.2
#r "nuget: Muonroi.RuleEngine.Core, 2.0.2"
#:package Muonroi.RuleEngine.Core@2.0.2
#addin nuget:?package=Muonroi.RuleEngine.Core&version=2.0.2
#tool nuget:?package=Muonroi.RuleEngine.Core&version=2.0.2
Muonroi.RuleEngine.Core
Core execution orchestrator for the Muonroi Rule Engine, providing rule evaluation, dependency resolution, and FactBag state management.
Installation
dotnet add package Muonroi.RuleEngine.Core
Overview
The core orchestration layer for executing rule pipelines. It defines RuleOrchestrator<TContext> which implements IMRuleOrchestrator<TContext> to evaluate sequences of IRule<TContext>. State transitions between rules are managed via the FactBag, and each rule returns a RuleResult determining execution flow based on the current ExecutionMode (e.g. AllOrNothing, BestEffort).
Features
- Engine Configuration:
MRuleEngineBuilderfor fluent setup of execution options and dependencies. - Rule Definitions:
IRule<TContext>for defining atomic pieces of logic, with properties for Code, Order, DependsOn, and HookPoint. - State Management:
FactBagfor strongly typed state passing between rules viaGet<T>()andSet<T>(). - Execution Orchestration:
IMRuleOrchestrator<TContext>andRuleOrchestrator<TContext>to execute rule chains and aggregate anOrchestratorResult. - Execution Modes: Configure behavior on failure via the
ExecutionModeenum (AllOrNothing, BestEffort, CompensateOnFailure).
Quick Start
// Configure engine dependencies and defaults
builder.Services.AddRuleEngine<OrderContext>(options =>
{
options.Mode = ExecutionMode.BestEffort;
});
// Resolve the orchestrator and execute
var orchestrator = provider.GetRequiredService<IMRuleOrchestrator<OrderContext>>();
var result = await orchestrator.ExecuteAsync(new OrderContext(), cancellationToken);
Ecosystem Combinations
+ Mediator → Rules Run Before Every Command
MRuleEngineBehavior in the mediator pipeline calls IMRuleOrchestrator.ExecuteAsync() before the handler. Business rules become hot-reloadable without touching handler code:
public class PlaceOrderCommand : IRequest<OrderDto>, IMRuleRequest
{
public string RuleContext => "ORDER_PLACEMENT";
}
// Handler is pure — rules evaluated by the pipeline, not the handler
+ Tenancy.Core → Per-Tenant Rule Quotas
ITenantQuotaTracker gates how many rule evaluations a tenant can execute per time window. Free tier: 1,000/day. Enterprise: unlimited.
+ Observability → Per-Rule OTel Spans
Every IRule<TContext>.EvaluateAsync() call becomes an OTel span via IRuleExecutionTracer. Diagnose slow rules in Grafana.
Full Rule Engine Production Stack
builder.Services
.AddRuleEngine<OrderContext>() // core orchestrator
.AddRuleEngineRuntime(config) // persistence + hot-reload
.AddTenantContext(config) // per-tenant quotas
.AddMuonroiObservability(config) // per-rule OTel spans
.AddMMediator(opt => opt.AddMuonroiEcosystem()); // rules in pipeline
Samples
License
Apache 2.0 — see LICENSE-APACHE.
| 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.Extensions.DependencyInjection (>= 10.0.3)
- Microsoft.Extensions.Http (>= 10.0.3)
- Microsoft.Extensions.Logging (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Options (>= 10.0.3)
- Muonroi.Core.Abstractions (>= 2.0.2)
- Muonroi.Governance.Abstractions (>= 2.0.2)
- Muonroi.Integration.Connectors (>= 2.0.2)
- Muonroi.Logging.Abstractions (>= 2.0.2)
- Muonroi.RuleEngine.Abstractions (>= 2.0.2)
- Scrutor (>= 4.1.0)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Muonroi.RuleEngine.Core:
| Package | Downloads |
|---|---|
|
Muonroi.RuleEngine.Runtime
Runtime orchestration layer for Muonroi RuleEngine, providing execution pipelines and integration points for rule evaluation services. |
|
|
Muonroi.RuleEngine.Testing
Testing helpers for Muonroi rule orchestration. |
|
|
Muonroi.Tenancy.SiteProfile.Web
ASP.NET Core middleware and SignalR hot-reload for Muonroi.Tenancy.SiteProfile. |
|
|
Muonroi.BuildingBlock.All
Metapackage for Muonroi Building Block - Includes all sub-packages for a complete infrastructure setup. |
|
|
Muonroi.Caching.Redis
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.2 | 273 | 8/26/2026 |
| 2.0.1 | 276 | 8/26/2026 |
| 2.0.0 | 316 | 8/14/2026 |
| 1.0.0-alpha.14 | 165 | 5/15/2026 |
v1.7.0: Updated to use new Abstractions v1.7.0 with Saga Pattern support. Added 48 new Theory tests for comprehensive edge case coverage.