Skip to content

EFCore analyzer improvements#941

Open
JoschiZ wants to merge 1 commit intoSteveDunn:mainfrom
JoschiZ:efcore-analyzer-improvements
Open

EFCore analyzer improvements#941
JoschiZ wants to merge 1 commit intoSteveDunn:mainfrom
JoschiZ:efcore-analyzer-improvements

Conversation

@JoschiZ
Copy link
Copy Markdown
Contributor

@JoschiZ JoschiZ commented May 8, 2026

  • Changes the DoNotCompareWithPrimitivesInEfCoreAnalyzer from Error to Warning: IQueryable is not only used in the context of EFCore, but wen cannot really differentiate between an EFCore IQueryable and something else. Thus this should probably be a warning, because false positives are likely.
  • Add VOG039 DoNotAccessValueInEfCoreAnalyzer: An analyzer that catches the access to MyVo.Value inside the expression tree of IQueryables as well as the old query syntax. Accessing those properties inside the context of EFCore queries will crash during runtime, because the query cannot be translated see [Question] Vogen in "dynamic" EntityFramework Core situations #699
  • Improved both analyzers to not rely on a hardcoded list of method names, but instead work on IQueryable extensions.
  • Made both analyzers only run in compilations that include EFCore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant