Install the SDK
Add the GoRules engine to your .NET project using the NuGet package.
dotnet add package GoRules.ZenEngineLoad a Decision
Create an engine instance and load your decision graph from a JSON file.
using GoRules.ZenEngine;
var engine = new ZenEngine(loader: null, customNode: null);
var content = new JsonBuffer(File.ReadAllBytes("decision.json"));
var decision = engine.CreateDecision(content);Evaluate Rules
Pass your input data and get the decision result in milliseconds.
var context = new JsonBuffer(@"{
""customer"": { ""tier"": ""premium"", ""country"": ""US"" },
""cart"": { ""total"": 150, ""items"": 3 }
}");
var result = await decision.Evaluate(context, null);
Console.WriteLine(result.result); // { "discount": 15, "freeShipping": true }Why C#?
Built for performance and developer experience
Rust-Powered Performance
Native bindings via UniFFI deliver near-native speed. Process thousands of rules in milliseconds with minimal overhead.
Cross-Platform
Pre-built native libraries for Windows (x64), macOS (x64/ARM), and Linux (x64/ARM). Just add the NuGet package.
Full .NET Integration
Works with .NET 8+, async/await patterns, and IDisposable. Integrates naturally with ASP.NET Core and other frameworks.
About the C# SDK
GoRules provides a high-performance business rules engine for .NET applications. The C# SDK delivers native bindings to our Rust core through UniFFI, giving you exceptional evaluation speed while maintaining a familiar, idiomatic C# developer experience.
The engine supports decision tables, expression evaluation, custom node handlers, and full execution tracing. Whether you're building pricing engines, eligibility checkers, or approval workflows in ASP.NET Core, background services, or console applications, GoRules handles the complexity while keeping your code clean and maintainable.
The SDK ships with pre-built native libraries for Windows (x64), macOS (x64/ARM), and Linux (x64/ARM), so there's nothing extra to configure. Just add the NuGet package and start evaluating rules. All processing happens in-process with no external service calls, making it ideal for high-throughput APIs and batch processing scenarios.