Fix rewriter when the sync method is in the same extensions class #110
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.
Pull request #108 made sure that EF Core async extensions (such as
AnyAsyncare properly translated to theSystem.Linq.Queryable.Anyextension method).Unfortunately, this introduced a regression. When async and sync methods are in the same extension class (such as ExecuteDeleteAsync and ExecuteDelete) the generated sync method would be wrong. I.e., generated in
System.Linq.Queryableinstead ofMicrosoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.This pull request tries to address this issue. Unfortunately, I'm again facing discrepancies between the
GenerationSandbox.TestsandGenerator.Testsprojects. This is why this pull request is opened a draft.When used in the
GenerationSandbox.Testsproject, the generated code is correct.When generated in the
Generator.Testsproject, the generated code is incorrect. Note how theAnyandExecuteDeletemethods are not generated with their fully qualified names.I don't understand why the generated code is different. I have identified that var symbol = GetSymbol(node) returns null for
InvocationExpressionSyntax InvocationExpression dbSet.AnyAsync(cancellationToken)inGenerator.Testsand not null inGenerationSandbox.Testsbut I don't understand why.