diff --git a/framework/src/Volo.Abp.Core/System/AbpTypeExtensions.cs b/framework/src/Volo.Abp.Core/System/AbpTypeExtensions.cs index 7742998c13..a90e4212e1 100644 --- a/framework/src/Volo.Abp.Core/System/AbpTypeExtensions.cs +++ b/framework/src/Volo.Abp.Core/System/AbpTypeExtensions.cs @@ -6,5 +6,30 @@ { return type.FullName + ", " + type.Assembly.GetName().Name; } + + /// + /// Determines whether an instance of this type can be assigned to + /// an instance of the . + /// + /// Internally uses . + /// + /// Target type (as reverse). + public static bool IsAssignableTo(this Type type) + { + return type.IsAssignableTo(typeof(TTarget)); + } + + /// + /// Determines whether an instance of this type can be assigned to + /// an instance of the . + /// + /// Internally uses (as reverse). + /// + /// this type + /// Target type + public static bool IsAssignableTo(this Type type, Type targetType) + { + return targetType.IsAssignableFrom(type); + } } }