Add .NET 10 / netstandard 2.1 support & fix Dictionary<string, object> regression (#720)#724
Open
YogeshPraj wants to merge 4 commits into
Open
Conversation
- 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
Contributor
Author
|
adding .net 10 support |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
net10.0andnetstandard2.1to RulesEngine target frameworksglobal.jsonSDK to 10.0.100net10.0to test, demo, and benchmark projectsnetstandard2.1Fix: Dictionary<string, object> key resolution (#720)
Utils.GetTypedObject()now convertsIDictionary<string, object>to a strongly-typed dynamic class (same pattern asExpandoObject)System.Linq.Dynamic.Coreupgrade from 1.3.7 to 1.6.x which changed how dictionary keys are resolvedRoot cause: The LINQ Dynamic library upgrade broke implicit property resolution on dictionary types. Only
ExpandoObjectwas being wrapped into a dynamic class —Dictionary<string, object>passed through raw and keys were treated as string literals.Testing
TestExpressionWithDictionaryParameter,TestExpressionWithDictionaryParameter_MultipleKeys)Fixes #720