RuleLoom.Extensions.DependencyInjection
0.5.0
See the version list below for details.
dotnet add package RuleLoom.Extensions.DependencyInjection --version 0.5.0
NuGet\Install-Package RuleLoom.Extensions.DependencyInjection -Version 0.5.0
<PackageReference Include="RuleLoom.Extensions.DependencyInjection" Version="0.5.0" />
<PackageVersion Include="RuleLoom.Extensions.DependencyInjection" Version="0.5.0" />
<PackageReference Include="RuleLoom.Extensions.DependencyInjection" />
paket add RuleLoom.Extensions.DependencyInjection --version 0.5.0
#r "nuget: RuleLoom.Extensions.DependencyInjection, 0.5.0"
#:package RuleLoom.Extensions.DependencyInjection@0.5.0
#addin nuget:?package=RuleLoom.Extensions.DependencyInjection&version=0.5.0
#tool nuget:?package=RuleLoom.Extensions.DependencyInjection&version=0.5.0
RuleLoom
An event-driven business rule engine for .NET. When something happens in your application (an order is placed, a price changes), RuleLoom runs the rules for that event against the current and previous state and runs or schedules their actions. Rules are written as JSON, so they can be stored and edited without a deployment, or built in code.
- Conditions with
eq,gt,gte,lt,lte,changed,and,or,not, plus your own operators - Paths on .NET objects or JSON state (
JsonElement,JsonNode), including the previous state ($previous.Price) - Values compared by meaning: numbers across types, enums by name, ISO 8601 strings as dates
- Actions you write (
IAction), with their own conditions and delayed or advance scheduling - Validation that reports every problem with its JSON location; failures reported in results, not thrown
Packages
| Package | Use it for |
|---|---|
RuleLoom |
The engine, built-in operators, validation |
RuleLoom.Abstractions |
Contracts and models only (no dependencies) |
RuleLoom.Extensions.DependencyInjection |
services.AddRuleLoom(...) |
Example
{
"id": "price-drop",
"name": "Price drop",
"eventType": "ProductUpdated",
"condition": { "operator": "lt", "operands": [{ "path": "Price" }, { "path": "$previous.Price" }] },
"actions": [{ "action": "send-email", "parameters": { "template": "price-drop" } }]
}
services.AddRuleLoom(rules => rules.AddAction<SendEmailAction>()); // "send-email"
var engine = scope.ServiceProvider.GetRequiredService<RuleEngine>();
var result = await engine.ExecuteAsync("ProductUpdated", current, previous, [RuleJsonParser.Parse(json)]);
Documentation
RuleLoom is pre-1.0: minor versions can contain breaking changes, listed in the upgrading guide.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- RuleLoom (>= 0.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RuleLoom.Extensions.DependencyInjection:
| Package | Downloads |
|---|---|
|
RuleLoom.AspNetCore
ASP.NET Core endpoints for RuleLoom: app.MapRuleLoom("/rules") serves the catalog document and validates rules for a rule-authoring UI. |
GitHub repositories
This package is not used by any popular GitHub repositories.