diff --git a/benchmark/RulesEngineBenchmark/Program.cs b/benchmark/RulesEngineBenchmark/Program.cs
index e8aeb7a7..8f332795 100644
--- a/benchmark/RulesEngineBenchmark/Program.cs
+++ b/benchmark/RulesEngineBenchmark/Program.cs
@@ -7,12 +7,16 @@
using System;
using System.Collections.Generic;
using System.IO;
+using BenchmarkDotNet.Jobs;
+using System.Text.Json;
namespace RulesEngineBenchmark
{
- using System.Text.Json;
[MemoryDiagnoser]
+ [SimpleJob(RuntimeMoniker.Net60)]
+ [SimpleJob(RuntimeMoniker.Net80)]
+ [SimpleJob(RuntimeMoniker.Net90)]
public class REBenchmark
{
private readonly RulesEngine.RulesEngine rulesEngine;
diff --git a/benchmark/RulesEngineBenchmark/RulesEngineBenchmark.csproj b/benchmark/RulesEngineBenchmark/RulesEngineBenchmark.csproj
index f6e806ac..0eb2c7bf 100644
--- a/benchmark/RulesEngineBenchmark/RulesEngineBenchmark.csproj
+++ b/benchmark/RulesEngineBenchmark/RulesEngineBenchmark.csproj
@@ -2,16 +2,16 @@
Exe
- net8.0
+ net6.0;net8.0;net9.0
-
-
+
+
-
+
diff --git a/demo/DemoApp.EFDataExample/DemoApp.EFDataExample.csproj b/demo/DemoApp.EFDataExample/DemoApp.EFDataExample.csproj
index 210fdad8..40577574 100644
--- a/demo/DemoApp.EFDataExample/DemoApp.EFDataExample.csproj
+++ b/demo/DemoApp.EFDataExample/DemoApp.EFDataExample.csproj
@@ -1,14 +1,14 @@
- net8.0
+ net8.0;net9.0
DemoApp.EFDataExample
DemoApp.EFDataExample
-
-
+
+
diff --git a/demo/DemoApp/DemoApp.csproj b/demo/DemoApp/DemoApp.csproj
index 626fa62c..83f0d8a7 100644
--- a/demo/DemoApp/DemoApp.csproj
+++ b/demo/DemoApp/DemoApp.csproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ net8.0;net9.0
DemoApp.Program
@@ -10,7 +10,7 @@
-
+
PreserveNewest
diff --git a/global.json b/global.json
index da113e4c..90b30429 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "8.0.0",
+ "version": "9.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
diff --git a/src/RulesEngine/HelperFunctions/Utils.cs b/src/RulesEngine/HelperFunctions/Utils.cs
index 4ae9262a..05df93dd 100644
--- a/src/RulesEngine/HelperFunctions/Utils.cs
+++ b/src/RulesEngine/HelperFunctions/Utils.cs
@@ -26,39 +26,46 @@ public static object GetTypedObject(dynamic input)
}
public static Type CreateAbstractClassType(dynamic input)
{
- List props = new List();
+ List props = [];
- if (input == null)
+ if (input is System.Text.Json.JsonElement jsonElement)
+ {
+ if (jsonElement.ValueKind == System.Text.Json.JsonValueKind.Null)
+ {
+ return typeof(object);
+ }
+ }
+ else if (input == null)
{
return typeof(object);
}
- if (!(input is ExpandoObject))
+
+ if (input is not ExpandoObject expandoObject)
{
return input.GetType();
}
- else
+ foreach (var expando in expandoObject)
{
- foreach (var expando in (IDictionary)input)
+ Type value;
+ if (expando.Value is IList list)
{
- Type value;
- if (expando.Value is IList)
+ if (list.Count == 0)
{
- if (((IList)expando.Value).Count == 0)
- value = typeof(List
-
-
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
diff --git a/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj b/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj
index 23de56b6..d8878314 100644
--- a/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj
+++ b/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj
@@ -1,21 +1,21 @@
- net8.0
+ net6.0;net8.0;net9.0
True
..\..\signing\RulesEngine-publicKey.snk
True
-
-
-
-
-
-
+
+
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive