Conversation
There was a problem hiding this comment.
Pull request overview
Continues the cleanup from #37533 by removing the SqlExpressionVisitor base class from the Cosmos provider, inlining its VisitExtension dispatch logic directly into CosmosQuerySqlGenerator.
Changes:
- Deleted
SqlExpressionVisitor.csand changedCosmosQuerySqlGeneratorto inherit fromExpressionVisitordirectly - Inlined the expression type dispatch switch into
CosmosQuerySqlGenerator.VisitExtension, throwing with a descriptive error for unhandled expressions - Changed all
Visit*methods fromprotected overridetoprotected virtual, and added a newUnhandledExpressionInVisitorresource string
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
SqlExpressionVisitor.cs |
Deleted — base class no longer needed |
CosmosQuerySqlGenerator.cs |
Now extends ExpressionVisitor; inlines dispatch switch; methods become virtual |
CosmosStrings.resx |
Added UnhandledExpressionInVisitor resource string |
CosmosStrings.Designer.cs |
Auto-generated accessor for the new resource string (has a duplicate summary bug) |
Files not reviewed (1)
- src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs: Language not supported
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the SqlExpressionVisitor base class from the Cosmos provider, continuing the cleanup started in #37533 for the relational provider. The VisitExtension dispatch logic is inlined directly into CosmosQuerySqlGenerator, and unhandled expressions now throw with a descriptive error message.
Changes:
- Deleted
SqlExpressionVisitor.csand moved its dispatch switch intoCosmosQuerySqlGenerator.VisitExtension - Changed all
Visit*methods fromprotected overridetoprotected virtualandsealed overridetoprotected virtual - Added
UnhandledExpressionInVisitorerror string resource for Cosmos
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
SqlExpressionVisitor.cs |
Deleted abstract visitor base class |
CosmosQuerySqlGenerator.cs |
Inlined VisitExtension dispatch; changed method modifiers from override/sealed override to virtual |
CosmosStrings.resx |
Added UnhandledExpressionInVisitor resource string |
CosmosStrings.Designer.cs |
Generated accessor for the new resource string |
Files not reviewed (1)
- src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs: Language not supported
You can also share your feedback on Copilot code review. Take the survey.
Cleanup, continues #37533