@@ -36,7 +36,7 @@ public static void AssertDefaultConstructor(this Type type, string message)
3636 }
3737 }
3838
39- return interfaces . FirstOrDefault ( item => IsAssignableToExpanded ( item , of ) ) ;
39+ return interfaces . FirstOrDefault ( item => IsCastableTo ( item , of ) ) ;
4040 }
4141
4242 public static Type ? GetGenericArgument ( this Type type , Type generic )
@@ -75,31 +75,31 @@ public static bool HasDefaultConstructor(this Type type)
7575 return null ;
7676 }
7777
78- public static IEnumerable < Type > InterfacesAssignableToExpanded < T > ( this Type type )
78+ public static IEnumerable < Type > InterfacesCastableTo < T > ( this Type type )
7979 {
80- return type . InterfacesAssignableToExpanded ( typeof ( T ) ) ;
80+ return type . InterfacesCastableTo ( typeof ( T ) ) ;
8181 }
8282
83- public static IEnumerable < Type > InterfacesAssignableToExpanded ( this Type type , Type interfaceType )
83+ public static IEnumerable < Type > InterfacesCastableTo ( this Type type , Type interfaceType )
8484 {
8585 Guard . AgainstNull ( interfaceType ) ;
8686
87- return type . GetInterfaces ( ) . Where ( i => IsAssignableToExpanded ( i , interfaceType ) ) . ToList ( ) ;
87+ return type . GetInterfaces ( ) . Where ( i => IsCastableTo ( i , interfaceType ) ) . ToList ( ) ;
8888 }
8989
90- public static bool IsAssignableToExpanded ( this Type type , Type otherType )
90+ public static bool IsCastableTo ( this Type type , Type otherType )
9191 {
9292 Guard . AgainstNull ( type ) ;
9393 Guard . AgainstNull ( otherType ) ;
9494
9595 return type . IsGenericType && otherType . IsGenericType
9696 ? otherType . GetGenericTypeDefinition ( ) . IsAssignableFrom ( type . GetGenericTypeDefinition ( ) )
9797 : otherType . IsGenericType
98- ? IsAssignableToGenericType ( type , otherType )
98+ ? IsCastableToGenericType ( type , otherType )
9999 : otherType . IsAssignableFrom ( type ) ;
100100 }
101101
102- private static bool IsAssignableToGenericType ( Type type , Type generic )
102+ private static bool IsCastableToGenericType ( Type type , Type generic )
103103 {
104104 return
105105 type . GetInterfaces ( )
0 commit comments