Esempio n. 1
0
 internal static bool IsSubTypeOf(TypeUsage subType, TypeUsage superType)
 {
     if (subType.EdmEquals((MetadataItem)superType))
     {
         return(true);
     }
     if (Helper.IsPrimitiveType(subType.EdmType) && Helper.IsPrimitiveType(superType.EdmType))
     {
         return(TypeSemantics.IsPrimitiveTypeSubTypeOf(subType, superType));
     }
     return(subType.IsSubtypeOf(superType));
 }
Esempio n. 2
0
        // <summary>
        // determines if subType is equal to or a sub-type of superType.
        // </summary>
        // <returns> true if subType is equal to or a sub-type of superType, false otherwise </returns>
        internal static bool IsSubTypeOf(TypeUsage subType, TypeUsage superType)
        {
            DebugCheck.NotNull(subType);
            DebugCheck.NotNull(superType);

            if (subType.EdmEquals(superType))
            {
                return(true);
            }

            if (Helper.IsPrimitiveType(subType.EdmType) &&
                Helper.IsPrimitiveType(superType.EdmType))
            {
                return(IsPrimitiveTypeSubTypeOf(subType, superType));
            }

            return(subType.IsSubtypeOf(superType));
        }