JsonLogic.Net is an implementation of JsonLogic in .Net platform. Implementation includes all supported operators documented on JsonLogic site.
JsonLogic.Net has a hard dependency on Newtonsoft.Json. It is a common library for json handling and very easy to use.
This fork uses SimpleJson embedded source (MIT).
// The data that the rule will run against. objectdata=new{MyNumber=8};// Rule definition retrieved as JSON textstringjsonText="{\">\": [{\"var\": \"MyNumber\"}, 3]}";// Parse json into hierarchical structurevarrule=JObject.Parse(jsonText);// Create an evaluator with default operators.varevaluator=newJsonLogicEvaluator(EvaluateOperators.Default);// Apply the rule to the data.objectresult=evaluator.Apply(rule,data);The evaluator does not maintain any state and is thread-safe. Depending on your use case, you can add the evaluator as a singleton in your dependency injection container. You can also have multiple evaluators with different custom operations.