Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. static class KnownTypesHelper
  2. {
  3. public static IEnumerable<Type> GetKnownTypes<T>()
  4. {
  5. var list = new List<Type>();
  6. var queryTypes = typeof(T).Assembly.GetExportedTypes()
  7. .Where(x => typeof(T).IsAssignableFrom(x) && !x.IsGenericTypeDefinition);
  8.  
  9. list.AddRange(queryTypes);
  10. return list;
  11. }
  12. }
Add Comment
Please, Sign In to add comment