Skip to content

Add .NET 10 / netstandard 2.1 support & fix Dictionary<string, object> regression (#720)#724

Open
YogeshPraj wants to merge 4 commits into
microsoft:mainfrom
YogeshPraj:feature/add-net10-netstandard2.1-support
Open

Add .NET 10 / netstandard 2.1 support & fix Dictionary<string, object> regression (#720)#724
YogeshPraj wants to merge 4 commits into
microsoft:mainfrom
YogeshPraj:feature/add-net10-netstandard2.1-support

Conversation

@YogeshPraj
Copy link
Copy Markdown
Contributor

Summary

This PR adds support for .NET 10 and netstandard 2.1, and fixes a silent regression in 6.0.0 where Dictionary<string, object> keys were no longer resolved as named properties in rule expressions.

Changes

.NET 10 & netstandard 2.1 support

  • Add net10.0 and netstandard2.1 to RulesEngine target frameworks
  • Update global.json SDK to 10.0.100
  • Add net10.0 to test, demo, and benchmark projects
  • Update conditional package references for netstandard2.1

Fix: Dictionary<string, object> key resolution (#720)

  • Utils.GetTypedObject() now converts IDictionary<string, object> to a strongly-typed dynamic class (same pattern as ExpandoObject)
  • This restores correct behavior after the System.Linq.Dynamic.Core upgrade from 1.3.7 to 1.6.x which changed how dictionary keys are resolved

Root cause: The LINQ Dynamic library upgrade broke implicit property resolution on dictionary types. Only ExpandoObject was being wrapped into a dynamic class — Dictionary<string, object> passed through raw and keys were treated as string literals.

Testing

  • Added 2 new unit tests (TestExpressionWithDictionaryParameter, TestExpressionWithDictionaryParameter_MultipleKeys)
  • All 121 existing tests pass on net10.0

Fixes #720

- Add net10.0 and netstandard2.1 to RulesEngine target frameworks
- Update global.json SDK to 10.0.100
- Add net10.0 to test, demo, and benchmark projects
- Update conditional package references for netstandard2.1
…ssions (microsoft#720)

When a Dictionary<string, object> is passed as a RuleParameter, convert it
to a strongly-typed dynamic class (same as ExpandoObject) so that dictionary
keys are resolved as named properties in System.Linq.Dynamic.Core 1.6.x.

This fixes a silent regression introduced in 6.0.0 where expressions like
Formule!="Essentielle" would always return true regardless of the actual
dictionary value.
Add comprehensive unit tests for dictionary-to-typed-object conversion
including nested dicts, lists, nulls, and ExpandoObject combinations.
This brings coverage above the 94% CI threshold.
- Add 10.0.x to dotnetcore-build.yml and codeql-analysis.yml
- Add net10.0 to DemoApp.EFDataExample target frameworks
@YogeshPraj
Copy link
Copy Markdown
Contributor Author

adding .net 10 support

@YogeshPraj YogeshPraj enabled auto-merge (squash) May 22, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in 6.0.0: Dictionary<string, object> keys no longer resolved in RuleExpressionParser expressions

1 participant