IsComplexType() public static method

Calls EntityMetadata.IsComplexType method.
public static IsComplexType ( Type t ) : bool
t System.Type
return bool
Exemplo n.º 1
0
        /// <summary>
        /// This is used to determine when a property should be followed.
        /// We don't want to follow navigation properties.
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public static bool IsNavigationProperty(Type t)
        {
            if (t.IsGenericType)
            {
                Type iEnumerableOfT = t.GetInterface("System.Collections.Generic.IEnumerable`1");
                if (iEnumerableOfT != null)
                {
                    t = iEnumerableOfT.GetGenericArguments()[0];
                }
                else if (t.IsInterface && t.Name == "IEnumerable`1")
                {
                    t = t.GetGenericArguments()[0];
                }
            }
            // We do want to follow complex types, but not entities.
            var isEntity = IsEntityOrComplexType(t) && !DevForceTypes.IsComplexType(t);

            return(isEntity);
        }