Skip to content

Instantly share code, notes, and snippets.

Created May 24, 2012 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2781941 to your computer and use it in GitHub Desktop.
Save anonymous/2781941 to your computer and use it in GitHub Desktop.
// <Name>Base class should not use derivatives</Name>
warnif count > 0
from baseClass in JustMyCode.Types
where baseClass.IsClass && baseClass.NbChildren > 0 // <-- for optimization!
let derivedClassesUsed = baseClass.DerivedTypes.UsedBy(baseClass)
where derivedClassesUsed.Count() > 0
select new { baseClass, derivedClassesUsed }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment