After searching I found an easy way to get the classes by given type. Using Linq getting the following code:
var type = typeof(IMyInterface);
var types = AppDomain.CurrentDomain.GetAssemblies()
.ToList()
.SelectMany(s => s.GetTypes())
.Where(p => type.IsAssignableFrom(p) && !p.IsInterface);
No comments:
Post a Comment