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}
![](https://secure.gravatar.com/avatar/088e2a532c2fe73a2a3d6d84a9a6a76c?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
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}