示例#1
0
        public static string EntityTypeFullName(this GStoreEntity entity)
        {
            if (entity.IsPoco())
            {
                return(entity.GetType().FullName);
            }

            return(entity.GetType().BaseType.FullName);
        }
示例#2
0
        /// <summary>
        /// Returns true if this object is an entity framework proxy object, not a POCO
        /// </summary>
        /// <param name="testObject"></param>
        /// <returns></returns>
        public static bool IsProxy(this GStoreEntity entity)
        {
            //check if the current object type is the base type, or an entity parent type
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            Type pocoType = System.Data.Entity.Core.Objects.ObjectContext.GetObjectType(entity.GetType());

            return(pocoType != entity.GetType());
        }
示例#3
0
 public static Type GetPocoType(this GStoreEntity entity)
 {
     return(System.Data.Entity.Core.Objects.ObjectContext.GetObjectType(entity.GetType()));
 }