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-
public IList GetClassByType() { return AppDomain.CurrentDomain.GetAssemblies() .SelectMany(s => s.GetTypes()) .ToList(p => typeof(T) .IsAssignableFrom(p) && !p.IsAbstract && !p.IsInterface) .SelectList(c => (T)Activator.CreateInstance(c)); }