JsonLogic.Net icon indicating copy to clipboard operation
JsonLogic.Net copied to clipboard

The "or" operator doesn't work as it should.

Open evyMascarenhas opened this issue 2 years ago • 1 comments

Hi, I'm trying to apply a complex rule that works on the js version, but not in the package: Example:

{
  "or": [
    {
      "and": [
        { ">": [{ "var": "DebtService" }, 0.5] },
        { ">=": [{ "var": "AnnualRevenue" }, 700] }
      ]
    },
    {  ">": [{ "var": "BNIScore" }, 10] }
  ]
}

data: { "DebtService" : 0.7, "AnnualRevenue": 100, "BNIScore": 20}

In this case, the "and" block returns false, and the ">" block returns true. Therefore, the final result should be "True" The JS version returns true, but when I try it in the .net project with this nuget package, it returns false. Any suggestions? Maybe the structure in C# should be different than the one used in JS?

Thanks!

evyMascarenhas avatar Jun 16 '22 17:06 evyMascarenhas

This works fine for me.

MaxHayman avatar Aug 23 '23 09:08 MaxHayman