Example #1
0
        /// <summary>
        /// 创建代理类
        /// </summary>
        /// <returns></returns>
        public static object Create(Type objType)
        {
            EntityInfoHandle handle = EntityInfoManager.GetEntityHandle(objType);

            if (handle != null)
            {
                return(handle.CreateProxyInstance());
            }
            return(null);
        }
Example #2
0
        /// <summary>
        /// 获取代理类类型
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public static Type GetProxyType(Type objType)
        {
            EntityInfoHandle handle = EntityInfoManager.GetEntityHandle(objType);

            if (handle != null)
            {
                return(handle.ProxyType);
            }
            return(null);
        }
Example #3
0
        /// <summary>
        /// 创建代理类
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public static T Create <T>() where T : EntityBase
        {
            Type             objType = typeof(T);
            EntityInfoHandle handle  = EntityInfoManager.GetEntityHandle(objType);

            if (handle != null)
            {
                return(handle.CreateProxyInstance() as T);
            }
            return(null);
        }
Example #4
0
        /// <summary>
        /// 获取代理类类型
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public static Type GetProxyType <T>() where T : EntityBase
        {
            Type             objType = typeof(T);
            EntityInfoHandle handle  = EntityInfoManager.GetEntityHandle(objType);

            if (handle != null)
            {
                return(handle.ProxyType);
            }
            return(null);
        }