Skip to content

Instantly share code, notes, and snippets.

@torkelo
Created October 20, 2010 12:16
Show Gist options
  • Save torkelo/636307 to your computer and use it in GitHub Desktop.
Save torkelo/636307 to your computer and use it in GitHub Desktop.
KnownTypesHelper
static class KnownTypesHelper
{
public static IEnumerable<Type> GetKnownTypes<T>()
{
var list = new List<Type>();
var queryTypes = typeof(T).Assembly.GetExportedTypes()
.Where(x => typeof(T).IsAssignableFrom(x) && !x.IsGenericTypeDefinition);
list.AddRange(queryTypes);
return list;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment