Skip to content

Instantly share code, notes, and snippets.

@faloi
Created May 14, 2013 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faloi/5579184 to your computer and use it in GitHub Desktop.
Save faloi/5579184 to your computer and use it in GitHub Desktop.
public static IEnumerable<Type> GetConcreteSubtypes(this Type anInterface)
{
var types = anInterface.Assembly.GetTypes();
return types.Where(type => (type.IsSubclassOf(anInterface) || type.GetInterfaces().Contains(anInterface)) && !type.IsAbstract);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment