Allow Implements to take a variable
It would be great to enable IType.Implement to allow passing an IType.Name instead of a string literal. That way this query would actually be possible where I am trying to get all classes that implement all interfaces. I can then check for unused interfaces.
let deps = new Func<IType, IEnumerable<IType>>(
t => from c in Types where c.Implement(t.FullName) select c
)
let allInterfaces = (from t in Types
where t.IsInterface
&& (t.IsPublic || t.IsInternal)
select t)
from t in allInterfaces
let dependencies = deps(t)
select new { t, dependencies}
-
You can rewrite this query this way, there is no need to change Implements()
let allInterfaces = (from t in Types
where t.IsInterface
&& (t.IsPublic || t.IsInternal)
select t)from t in allInterfaces
let dependencies = t.TypesThatImplementMe
select new { t, dependencies}