DecisionRules 2.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package DecisionRules --version 2.0.1
NuGet\Install-Package DecisionRules -Version 2.0.1
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="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DecisionRules --version 2.0.1
#r "nuget: DecisionRules, 2.0.1"
#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=2.0.1

// Install DecisionRules as a Cake Tool
#tool nuget:?package=DecisionRules&version=2.0.1

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 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.

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
3.0.6 11,699 7/22/2022
3.0.5 404 7/22/2022
3.0.4 443 6/27/2022
3.0.3 404 6/15/2022
3.0.2 400 6/6/2022
3.0.0 402 5/6/2022
2.0.1 450 1/24/2022
2.0.0 294 10/8/2021
1.6.5 274 9/23/2021
1.6.3 424 1/24/2022
1.5.3 299 8/3/2021
1.5.1 307 7/26/2021
1.4.2 311 6/28/2021