src/Mimp.SeeSharper.Reflection/TypeExtensions.Inherit.cs
/// <summary>
/// Check if inherit or assignable to <paramref name="inheritType"/>.
/// </summary>
/// <param name="type"></param>
/// <param name="inheritType"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
Check if inherit or assignable to .
Check if inherit or assignable to .
public static bool InheritOrAssignable(this Type type, Type inheritType)
        {
            if (type is null)
                throw new ArgumentNullException(nameof(type));
            if (inheritType is null)
                throw new ArgumentNullException(nameof(inheritType));
            return type.IsAssignableTo(inheritType) || type.Inherit(inheritType);
        }
public static bool InheritOrAssignable ( this Type type , Type inheritType ) { if ( type is null ) throw new ArgumentNullException ( nameof ( type ) ) ; if ( inheritType is null ) throw new ArgumentNullException ( nameof ( inheritType ) ) ; return type . IsAssignableTo ( inheritType ) || type . Inherit ( inheritType ) ; }
Check if inherit or assignable to .
Check if inherit or assignable to .
None
None
Type
this
inheritType
Type
None
type
None