-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Inline user implemented queryable mapping expressions (#1169)
Tries to inline user-implemented methods with an expression body into queryable expression mappings. This leads to better query mappings by EF Core and should result in less data loaded. If the inlining fails for some reason (e.g. not a valid c# expression tree), RMG068 is reported. This works with a syntax rewriter (InlineExpressionRewriter) which * extends type names to their fully qualified names (since the using statements are not present in the generated code) * expands extension method invocations (since the using statements are not present in the generated code) * extracts invocations of other user-defined mappings, to be inlined by the mapping itself * tries to assume whether the given code can be successfully inlined in a c# expression tree by checking the presence of given syntax declarations Additionally a new mapping is added (UserImplementedInlinedExpressionMapping) which represents an inlined version of a user implemented mapping. When building the mapping, it rewrites the source parameter of the user-method to the actual source of the mapping. Additionally mapping invocations extracted by the InlineExpressionRewriter are inlined. Fixes #953.
- Loading branch information
Showing
60 changed files
with
1,209 additions
and
156 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Oops, something went wrong.