I would like to write DiagnosticAnalyzer
, which analyzes if a class (ie. BotAggregate
) declared in a MyProject.Domain
assembly has it's own DbSet<BotAggregate>
declared in MyProjectDbContext
class which is placed in MyProject.EFCore
assembly.
When I do place the analyzer in MyProject.EFCore
project, it does not even see the BotAggregate
class declaration (because it scans the assembly where analyzer is referenced). And if I place the analyzer in MyProject.Domain
it could not access the MyProjectDbContext
to check if there is a required property.
Is it even possible to "cross check" the declaration and usage by Roslyn analyzer?