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

Precompiled queries: only process queries for the specific context type #33866

Open
AndriySvyryd opened this issue May 31, 2024 · 0 comments
Open

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented May 31, 2024

When encountering a query for a different context this exception is currently thrown:

QueryPrecompilationError { SyntaxNode = context.Blogs.Count(), Exception = System.InvalidOperationException: Encountered unknown identifier name 'context', which doesn't correspond to a lambda parameter or captured variable
   at Microsoft.EntityFrameworkCore.Query.Internal.CSharpToLinqTranslator.VisitIdentifierName(IdentifierNameSyntax identifierName)
   at Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax.Accept[TResult](CSharpSyntaxVisitor`1 visitor)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1.Visit(SyntaxNode node)
   at Microsoft.EntityFrameworkCore.Query.Internal.CSharpToLinqTranslator.Visit(SyntaxNode node)
   at Microsoft.EntityFrameworkCore.Query.Internal.CSharpToLinqTranslator.VisitMemberAccessExpression(MemberAccessExpressionSyntax memberAccess)
   at Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax.Accept[TResult](CSharpSyntaxVisitor`1 visitor)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1.Visit(SyntaxNode node)
   at Microsoft.EntityFrameworkCore.Query.Internal.CSharpToLinqTranslator.Visit(SyntaxNode node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants