The best solution would be to write your own Roslyn analyzer.
Then it's relatively easy to prevent any synchronous access over IQueryable, DbSet, ...
You would need to consider a regular foreach as well.