Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:2781941
Created May 24, 2012

What would you like to do?
// <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