示例#1
0
 internal static bool IsStructuralType(EdmType type)
 {
     if (!Helper.IsComplexType(type) && !Helper.IsEntityType(type) && !Helper.IsRelationshipType(type))
     {
         return(Helper.IsRowType((GlobalItem)type));
     }
     return(true);
 }
示例#2
0
 internal static bool IsEntityTypeBase(EdmType edmType)
 {
     if (!Helper.IsEntityType(edmType))
     {
         return(Helper.IsRelationshipType(edmType));
     }
     return(true);
 }
示例#3
0
        /// <summary>
        ///     internal static method to get the relationship name
        /// </summary>
        /// <param name="clrType"> </param>
        /// <param name="relationshipName"> </param>
        /// <returns> </returns>
        internal static AssociationType GetRelationshipTypeExpensiveWay(Type entityClrType, string relationshipName)
        {
            var typesInLoading = LoadTypesExpensiveWay(entityClrType.Assembly);

            if (typesInLoading != null)
            {
                EdmType edmType;
                // Look in typesInLoading for relationship type
                if (typesInLoading.TryGetValue(relationshipName, out edmType) &&
                    Helper.IsRelationshipType(edmType))
                {
                    return((AssociationType)edmType);
                }
            }
            return(null);
        }
        public virtual AssociationType GetRelationshipTypeExpensiveWay(Type entityClrType, string relationshipName)
        {
            DebugCheck.NotNull(entityClrType);
            DebugCheck.NotEmpty(relationshipName);

            var typesInLoading = LoadTypesExpensiveWay(entityClrType.Assembly());

            if (typesInLoading != null)
            {
                EdmType edmType;
                // Look in typesInLoading for relationship type
                if (typesInLoading.TryGetValue(relationshipName, out edmType) &&
                    Helper.IsRelationshipType(edmType))
                {
                    return((AssociationType)edmType);
                }
            }
            return(null);
        }
        public virtual AssociationType GetRelationshipTypeExpensiveWay(
            Type entityClrType,
            string relationshipName)
        {
            Dictionary <string, EdmType> dictionary = this.LoadTypesExpensiveWay(entityClrType.Assembly());
            EdmType type;

            if (dictionary != null && dictionary.TryGetValue(relationshipName, out type) && Helper.IsRelationshipType(type))
            {
                return((AssociationType)type);
            }
            return((AssociationType)null);
        }