Search This Blog

Wednesday, April 1, 2015

Reflection to find all classes implementing interface c#

C# > Reflection Find classes implementing interface

var iTtype = typeof(Interface);
var types = AppDomain.CurrentDomain.GetAssemblies()
           .SelectMany(a => a.GetTypes())
           .Where(t => iTtype.IsAssignableFrom(t));