src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Return true if the property's type is a complex type.
///     Return false otherwise.
///     Note: for consistent behavior with the older designer, this method will also return true if the type reference is not found.
/// </summary>
Return true if the property's type is a complex type.
Return false otherwise.
Note: for consistent behavior with the older designer, this method will also return true if the type reference is not found.
Return true if the property ' s type is a complex type . Return false otherwise . Note : for consistent behavior with the older designer this method will also return true if the type reference is not found .
internal static bool IsElementComplexProperty(XElement elem, ConceptualEntityModel conceptualModel)
        {
            string attrValue = null;
            var attr = elem.FirstAttribute;
            while (attr != null)
            {
                if (attr.Name.LocalName == Property.AttributeType)
                {
                    attrValue = attr.Value;
                    break;
                }
                attr = attr.NextAttribute;
            }
            if (attrValue != null)
            {
                var schemaVersion = SchemaManager.GetSchemaVersion(elem.Name.Namespace);
                if (AllPrimitiveTypes(schemaVersion).Contains(attrValue, StringComparer.Ordinal))
                {
                    return false;
                }
                else if (conceptualModel.EnumTypes().Any(et => attrValue.EndsWith(et.LocalName.Value, StringComparison.Ordinal)))
                {
                    return false;
                }
                return true;
            }
            return true;
        }
internal static bool IsElementComplexProperty ( XElement elem , ConceptualEntityModel conceptualModel ) { string attrValue = null ; var attr = elem . FirstAttribute ; while ( attr != null ) { if ( attr . Name . LocalName == Property . AttributeType ) { attrValue = attr . Value ; break ; } attr = attr . NextAttribute ; } if ( attrValue != null ) { var schemaVersion = SchemaManager . GetSchemaVersion ( elem . Name . Namespace ) ; if ( AllPrimitiveTypes ( schemaVersion ) . Contains ( attrValue , StringComparer . Ordinal ) ) { return false ; } else if ( conceptualModel . EnumTypes ( ) . Any ( et => attrValue . EndsWith ( et . LocalName . Value , StringComparison . Ordinal ) ) ) { return false ; } return true ; } return true ; }
Return true if the property's type is a complex type.
Return true if the property ' s type is a complex type .
// attrValue is null if there is no type attribute, obviously a mal-formed document, but possible // Check if it is one of the primitive types. // Check if it is one of the enum types. // Since a name has to be unique across all enum types and complex types, we assume that the type must be a complex type.
elem
XElement
conceptualModel
ConceptualEntityModel