Galosoft.IaaS.RulesEngine
25.1.16.2-nj
This is a prerelease version of Galosoft.IaaS.RulesEngine.
dotnet add package Galosoft.IaaS.RulesEngine --version 25.1.16.2-nj
NuGet\Install-Package Galosoft.IaaS.RulesEngine -Version 25.1.16.2-nj
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Galosoft.IaaS.RulesEngine" Version="25.1.16.2-nj" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Galosoft.IaaS.RulesEngine --version 25.1.16.2-nj
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Galosoft.IaaS.RulesEngine, 25.1.16.2-nj"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Galosoft.IaaS.RulesEngine as a Cake Addin #addin nuget:?package=Galosoft.IaaS.RulesEngine&version=25.1.16.2-nj&prerelease // Install Galosoft.IaaS.RulesEngine as a Cake Tool #tool nuget:?package=Galosoft.IaaS.RulesEngine&version=25.1.16.2-nj&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
注入
services.AddMicrosoftRulesEngine(context.Configuration);//inject rules engine galoS@2023-11-8 09:17:42
配置示例参考
"re": [
{
"WorkflowName": "discount-calculator",
"Rules": [
{
"RuleName": "GiveDiscount10",
"Expression": "input1.country == \"india\" AND input1.loyalityFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input1.totalOrders > 2 AND input1.noOfVisitsPerMonth > 2",
"SuccessEvent": 1 //计算规则
},
{
"RuleName": "GiveDiscount20",
"Expression": "input1.country == \"india\" AND input1.loyalityFactor == 3 AND input1.totalPurchasesToDate >= 10000 AND input1.totalOrders > 2 AND input1.noOfVisitsPerMonth > 2",
"SuccessEvent": 2
}
]
}
]
使用
var re = sp.GetRequiredService<IRulesEngine>();
var names = re.GetAllRegisteredWorkflowNames();
//var rt = await re.ExecuteAllRulesAsync("discount-calculator", new DiscountCalcuateInput()
//{
// Country = "india",
// LoyalityFactor = 2,
// TotalPurchasesToDate = 5000,
// TotalOrders = 10,
// NoOfVisitsPerMonth = 3,
//});
var rt = await re.ExecuteAllRulesAsync("discount-calculator",new DiscountCalcuateInput()
{
Country = "india",
LoyalityFactor = 3,
TotalPurchasesToDate = 10000,
TotalOrders = 10,
NoOfVisitsPerMonth = 3,
});
rt.OnSuccess(val =>
{
});
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Galosoft.IaaS.Core (>= 25.1.16.2-nj)
- rulesengine (>= 5.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
25.1.16.2-nj | 35 | 1/16/2025 |
24.12.4-nj | 53 | 12/4/2024 |