DecisionRules 1.6.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DecisionRules --version 1.6.3
NuGet\Install-Package DecisionRules -Version 1.6.3
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="DecisionRules" Version="1.6.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DecisionRules --version 1.6.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DecisionRules, 1.6.3"
#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 DecisionRules as a Cake Addin #addin nuget:?package=DecisionRules&version=1.6.3 // Install DecisionRules as a Cake Tool #tool nuget:?package=DecisionRules&version=1.6.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
A simple library that allows you to easily connect to Decisionrules.io from your application.
Request Options
- API_KEY - Your API_KEY (string)
- Geolocation - optional argument. If omited default geoloc is set. Our geolocs (string)
- URI - Custom base URL for on-premise version of DecisionRules (if omited our default uri is used (api.decisionrules.io)); (string)
Arguments
- U - generic return type
- T - generic input argument
- JsonStringInput - input model in JSON string format instead of T type. (string)
- Version - optional parameter that defines which version of rule you want to use in solver API. If omitted last version is used. (string)
Standard usage
namespace DemoApp
{
class Program
{
// Define apikey value;
private static readonly string apiKey = "API_KEY_HERE";
// Define ruleId value;
private static readonly string ruleId = "RULE_ID_HERE";
static void Main(string[] args)
{
// Mandatory RequestOption object that contains API key and Geolocation from GeoLocations enum.
RequestOption requestOptions = new RequestOption(apiKey, GeoLocations.DEFAULT);
// Init of DecisionRulesService
DecisionRulesService drs = new DecisionRulesService(requestOptions);
InputData inputModel = new InputData
{
day = "today"
};
string inputJSON = @"{""data"": {""day"":""today""}}";
// Standard Solver method usage that returns Result.
List<ResultModel> response = drs.Solve<InputData, ResultModel>(ruleId, inputModel, SolverStrategies.STANDARD ,"VERSION_HERE", solverType: SolverTypeEnum.RULE).Result;
List<ResultModel> responseString = drs.Solve<ResultModel>(ruleId, inputJSON, SolverStrategies.STANDARD ,"VERSION_HERE" solverType: SolverTypeEnum.RULE_FLOW).Result;
}
}
}
Usage with a custom domain
namespace DemoApp
{
class Program
{
private static readonly string apiKey = "API_KEY_HERE";
private static readonly string ruleId = "RULE_ID_HERE";
static void Main(string[] args)
{
// Custom domain object that contains your custom domain and desired transfer protocol
CustomDomain customDomain = new CustomDomain("your.domain.com", CustomDomainProtocol.HTTP);
RequestOption requestOptions = new RequestOption(apiKey: apiKey, geoloc:GeoLocations.DEFAULT, customDomain: customDomain);
DecisionRulesService drs = new DecisionRulesService(requestOptions);
..........
}
}
}
InputModel preview example
class InputModel
{
public string day { get; set; }
}
ResultModel preview example
class ResultModel
{
public string result { get; set; }
}
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 was computed. 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. |
.NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.