Rulewright.Core
0.3.0
dotnet add package Rulewright.Core --version 0.3.0
NuGet\Install-Package Rulewright.Core -Version 0.3.0
<PackageReference Include="Rulewright.Core" Version="0.3.0" />
<PackageVersion Include="Rulewright.Core" Version="0.3.0" />
<PackageReference Include="Rulewright.Core" />
paket add Rulewright.Core --version 0.3.0
#r "nuget: Rulewright.Core, 0.3.0"
#:package Rulewright.Core@0.3.0
#addin nuget:?package=Rulewright.Core&version=0.3.0
#tool nuget:?package=Rulewright.Core&version=0.3.0
Rulewright.Core
Foundation package for Rulewright: the immutable domain model a rule is made of, plus the result and trace types an evaluation produces.
Zero dependencies.
Install
dotnet add package Rulewright.Core
You almost certainly want Rulewright
instead — it includes this package. Install Rulewright.Core directly only when you are
writing something that plugs into Rulewright and does not need the rest of it: a rule
generator, an analyzer, or a custom function library.
What is in it
The rule model — RuleSet, Rule, and the condition tree: ConditionNode with its two
shapes, ConditionGroup (AND/OR/NOT over children) and ConditionLeaf (a field path or
computed expression, a ConditionOperator, and a constant). Everything is immutable after
construction and validated in the constructor.
using Rulewright.Core;
var rule = new Rule(
"adults-only",
new ConditionLeaf("Customer.Age", ConditionOperator.GreaterThanOrEqual, 18),
new[] { new RuleAction(RuleAction.SetOutputType, "Eligible", true) });
Actions — RuleAction and its four types: setOutput replaces, addToOutput sums,
appendToOutput collects into a list, removeOutput deletes the key.
Value expressions — ValueExpression and its three shapes, LiteralExpression,
FieldExpression, and OperatorExpression (arithmetic, concat, coalesce). Pure data: a
closed operator vocabulary, never embedded code.
Results and traces — RuleEvaluationResult, FiredRule (with the RuleBranch that ran),
EvaluationTrace, RuleTrace, and ConditionTraceNode, whose Passed is null for a node
short-circuiting skipped. CompilationMode reports whether an evaluation ran compiled
delegates or the interpreter, so a fallback is never silent.
Custom function contracts — IRuleFunction, IRuleFunctionMetadata,
RuleFunctionDescriptor, and RuleFunctionValueKind: implement IRuleFunction to back the
custom operator, and add the metadata interface so a builder UI can discover it.
Requirements
.NET Framework 4.8, .NET Standard 2.0, .NET 8.0 or .NET 10.0.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Rulewright.Core:
| Package | Downloads |
|---|---|
|
Rulewright.Serialization
Rulewright JSON-to-domain mapping, structural schema validation with JSON pointer errors, and canonical rule hashing. JSON parsing is abstracted behind IRuleJsonReader; no JSON library dependency. |
|
|
Rulewright.Execution
Rulewright execution engine: expression-tree rule compiler, dynamic-fact interpreter fallback, thread-safe compiled delegate cache, and the RulewrightBuilder/RulewrightEngine public API. |
|
|
Rulewright.Extensions.Functions
Built-in custom functions and registration/discovery helpers for Rulewright (the 'custom' operator). |
|
|
Rulewright
The Rulewright rule engine — everything you need in one package: the core domain model, JSON parsing and schema validation, the expression-tree evaluation engine, the System.Text.Json adapter, and the built-in custom functions. Rules are plain JSON; evaluation is compiled expression trees. Install this unless you want to pick pieces individually. |
GitHub repositories
This package is not used by any popular GitHub repositories.
See https://github.com/albahadly/rulewright/releases for release notes.