Get all types implementing specific open generic type

This will return all types that inherit a generic base class. Not all types that inherit a generic interface. var AllTypesOfIRepository = from x in Assembly.GetAssembly(typeof(AnyTypeInTargetAssembly)).GetTypes() let y = x.BaseType where !x.IsAbstract && !x.IsInterface && y != null && y.IsGenericType && y.GetGenericTypeDefinition() == typeof(IRepository<>) select x; This will return all types, including interfaces, abstracts, and … Read more

Higher-order type functions in TypeScript?

You’re correct, it’s not currently representable in TypeScript. There’s a longstanding open GitHub feature request, microsoft/TypeScript#1213, which should probably be titled something like “support higher kinded types” but currently has the title “Allow classes to be parametric in other parametric classes”. There are some ideas in the discussion about how to simulate such higher kinded … Read more