public static string EntityTypeFullName(this GStoreEntity entity) { if (entity.IsPoco()) { return(entity.GetType().FullName); } return(entity.GetType().BaseType.FullName); }
/// <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()); }
public static Type GetPocoType(this GStoreEntity entity) { return(System.Data.Entity.Core.Objects.ObjectContext.GetObjectType(entity.GetType())); }