RuleLoom.Extensions.DependencyInjection
0.7.0
See the version list below for details.
dotnet add package RuleLoom.Extensions.DependencyInjection --version 0.7.0
NuGet\Install-Package RuleLoom.Extensions.DependencyInjection -Version 0.7.0
<PackageReference Include="RuleLoom.Extensions.DependencyInjection" Version="0.7.0" />
<PackageVersion Include="RuleLoom.Extensions.DependencyInjection" Version="0.7.0" />
<PackageReference Include="RuleLoom.Extensions.DependencyInjection" />
paket add RuleLoom.Extensions.DependencyInjection --version 0.7.0
#r "nuget: RuleLoom.Extensions.DependencyInjection, 0.7.0"
#:package RuleLoom.Extensions.DependencyInjection@0.7.0
#addin nuget:?package=RuleLoom.Extensions.DependencyInjection&version=0.7.0
#tool nuget:?package=RuleLoom.Extensions.DependencyInjection&version=0.7.0
RuleLoom
Let your users weave their own business rules. You provide the threads (events, operators and actions); rules written as JSON, or built in code, combine them without a deployment. 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.
- 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(...) |
RuleLoom.AspNetCore |
app.MapRuleLoom("/rules"): the catalog and rule validation endpoints for an authoring UI |
RuleLoom.Schemas |
Event schemas (fields, labels, contexts) as JSON Schema, generated from your DTOs |
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.AddCatalog(catalog => catalog.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)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- RuleLoom (>= 0.7.0)
- RuleLoom.Schemas (>= 0.7.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.