Skip to content
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 to #30115 - IndexOutOfRangeException in CreateNavigationExpansionExpression #30591

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Mar 28, 2023

Port of #30537
Fixes #30115

Description

Entity based on clr types generated by the compiler (i.e. having non-standard names) throw during compilation.

Customer impact

Queries with affected entities throw during translation.

How found

Customer report on 7.0

Regression

Yes. This scenario worked correctly in previous version of EF Core.

Testing

Added regression tests for affected scenario.

Risk

Low/minimal: Scenario is quite an edge case since the names for types that would trigger the issue can't be generated with regular user code. Also fix is very straightforward and the code path affected (apart from this one case) is only used for error reporting. So at worst the fix is incomplete for the same class of issues, but it shouldn't regress into other scenarios. Added quirk to revert to old behavior if necessary.

@maumar maumar changed the title Fix to #30115 - IndexOutOfRangeException in CreateNavigationExpansionExpression(Expression sourceExpression, IEntityType entityType) / get_Chars(Int32 index) when EF class named "<>f__AnonymousType01Child" in 7.0.2 version [release/7.0] Fix to #30115 - IndexOutOfRangeException in CreateNavigationExpansionExpression(Expression sourceExpression, IEntityType entityType) / get_Chars(Int32 index) when EF class named "<>f__AnonymousType01Child" in 7.0.2 version Mar 28, 2023
…Expression(Expression sourceExpression, IEntityType entityType) / get_Chars(Int32 index) when EF class named "<>f__AnonymousType01Child" in 7.0.2 version

Adjusting ShortName to trim "<>" from the start of the type name.

Fixes #30115
@maumar maumar added this to the 7.0.x milestone Mar 28, 2023
@AndriySvyryd AndriySvyryd changed the title [release/7.0] Fix to #30115 - IndexOutOfRangeException in CreateNavigationExpansionExpression(Expression sourceExpression, IEntityType entityType) / get_Chars(Int32 index) when EF class named "<>f__AnonymousType01Child" in 7.0.2 version [release/7.0] Fix to #30115 - IndexOutOfRangeException in CreateNavigationExpansionExpression Mar 29, 2023
@rbhanda rbhanda modified the milestones: 7.0.x, 7.0.6 Mar 30, 2023
@wtgodbe wtgodbe merged commit 86b202d into release/7.0 Apr 4, 2023
@wtgodbe wtgodbe deleted the fix30115_70 branch April 4, 2023 19:27
@rbhanda rbhanda modified the milestones: 7.0.6, 7.0.7 Jun 1, 2023
@ajcvickers ajcvickers removed this from the 7.0.7 milestone Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants