using System; using System.Linq; public abstract class AbstractValidator { } public class CreateTripValidator : AbstractValidator {} public class CancelTripValidator : AbstractValidator {} public class Test { public static void Main() { var validatorType = typeof(AbstractValidator<>); Console.WriteLine(string.Join(",", validatorType.Assembly .GetTypes() .Where(t => IsSubclassOfRawGeneric(validatorType, t)) .Select(t => t.Name) .ToArray())); } private static bool IsSubclassOfRawGeneric(Type baseType, Type derivedType) { while (derivedType != null && derivedType != typeof(object)) { var currentType = derivedType.IsGenericType ? derivedType.GetGenericTypeDefinition() : derivedType; if (baseType == currentType) { return true; } derivedType = derivedType.BaseType; } return false; } }