-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/7.0] Fix for some minor bugs around JSON mappings #29227
Merged
Conversation
This file contains 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
smitpatel
reviewed
Sep 29, 2022
...l/Query/RelationalShapedQueryCompilingExpressionVisitor.ShaperProcessingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
smitpatel
reviewed
Sep 29, 2022
...l/Query/RelationalShapedQueryCompilingExpressionVisitor.ShaperProcessingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
smitpatel
reviewed
Sep 29, 2022
...l/Query/RelationalShapedQueryCompilingExpressionVisitor.ShaperProcessingExpressionVisitor.cs
Show resolved
Hide resolved
maumar
force-pushed
the
json_bug_fixes
branch
from
September 29, 2022 05:31
ddf33c5
to
b516994
Compare
smitpatel
reviewed
Sep 29, 2022
...l/Query/RelationalShapedQueryCompilingExpressionVisitor.ShaperProcessingExpressionVisitor.cs
Show resolved
Hide resolved
maumar
force-pushed
the
json_bug_fixes
branch
3 times, most recently
from
October 1, 2022 02:58
120be77
to
d479370
Compare
maumar
changed the title
Fix for some minor bugs around JSON mappings
[release/7.0] Fix for some minor bugs around JSON mappings
Oct 1, 2022
#29214 - Json column: constructor with optional enum-parameter throws ArgumentException When producing shaper code for json nullable properties with converters we check if the converter handles null, if not we need to peek into the json value and only pass it thru converter if it's not null, and return null otherwise #29217 - Json: nullable enums on entities mapped to json don't use enum-to-int converter, rather than string, like for non-nullable enums In convention code unwrap nullable type when testing for enum properties that we then apply converter to string #29225 - Json: projecting nullable scalar produces debug.assert in SqlExpression ctor Unwrap nullable type from property before passing it as type to SqlExpression ctor #29219 - Json: error when trying to materialize json entity with nullable property that is missing in the json string - should materialize the property as null instead Modify ExtractJsonProperty method so that it used TryGetProperty when trying to extract nullable properties. Fixes #29214 Fixes #29217 Fixes #29225 Fixes #29219
smitpatel
approved these changes
Oct 4, 2022
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.
This is a collection of small fixes for JSON column mapping, which is a major new feature in EF7. We're bringing them together because @maumar has been out on vacation and these are fixes for the minor issues discovered while he was out. We will bring any future fixes individually.
Descriptions
#29214 - Json column: constructor with optional enum-parameter throws ArgumentException
When producing shaper code for json nullable properties with converters we check if the converter handles null, if not we need to peek into the json value and only pass it thru converter if it's not null, and return null otherwise
#29217 - Json: nullable enums on entities mapped to json don't use enum-to-int converter, rather than string, like for non-nullable enums
In convention code unwrap nullable type when testing for enum properties that we then apply converter to string
#29225 - Json: projecting nullable scalar produces debug.assert in SqlExpression ctor
Unwrap nullable type from property before passing it as type to SqlExpression ctor
#29219 - Json: error when trying to materialize json entity with nullable property that is missing in the json string - should materialize the property as null instead
Modify ExtractJsonProperty method so that it used TryGetProperty when trying to extract nullable properties.
Customer impact
Fixes for paper cuts in the JSON column mapping feature.
How found
Customer reported, team testing, and writing samples.
Regression
No; new feature in EF7.
Testing
New testing added.
Risk
Low-risk fixes for polishing.
Fixes #29214
Fixes #29217
Fixes #29225
Fixes #29219