EFUtility.CodeGenerationTools.MetadataTools.IsSubtypeOf C# (CSharp) Method

IsSubtypeOf() public method

requires: firstType is not null effects: if secondType is among the base types of the firstType, return true, otherwise returns false. when firstType is same as the secondType, return false.
public IsSubtypeOf ( System.Data.Metadata.Edm.EdmType firstType, System.Data.Metadata.Edm.EdmType secondType ) : bool
firstType System.Data.Metadata.Edm.EdmType
secondType System.Data.Metadata.Edm.EdmType
return bool
        public bool IsSubtypeOf(EdmType firstType, EdmType secondType)
        {
            if (secondType == null)
            {
                return false;
            }

            // walk up firstType hierarchy list
            for (EdmType t = firstType.BaseType; t != null; t = t.BaseType)
            {
                if (t == secondType)
                    return true;
            }
            return false;
        }