private static IEnumerable <Type> TypesAssignableFrom(Type candidateType) { return(candidateType.GetTypeInfo().ImplementedInterfaces.Concat( Traverse.Across(candidateType, t => t.GetTypeInfo().BaseType))); }
static IEnumerable <Type> TypesAssignableFrom(Type candidateType) { return(candidateType.GetInterfaces().Concat( Traverse.Across(candidateType, t => t.BaseType))); }
private static bool ParameterCompatibleWithTypeConstraint(Type parameter, Type constraint) { return(constraint.IsAssignableFrom(parameter) || Traverse.Across <Type>(parameter, p => p.BaseType).Concat <Type>(parameter.GetInterfaces()).Any <Type>(p => p.GUID.Equals(constraint.GUID))); }