Using reflection, how can I get all types that implement an interface with C# 3.0/.NET 3.5 with the least code, and minimizing iterations?
This is what I want to re-
This worked for me (if you wish you could exclude system types in the lookup):
Type lookupType = typeof (IMenuItem); IEnumerable lookupTypes = GetType().Assembly.GetTypes().Where( t => lookupType.IsAssignableFrom(t) && !t.IsInterface);