86 references to WrappedEntity
System.Data.Entity (86)
System\Data\Common\Internal\Materialization\Shaper.cs (8)
157result = existingEntry.WrappedEntity; 204if (typeof(TEntity) != existingEntry.WrappedEntity.IdentityType) 206throw EntityUtil.RecyclingEntity(existingEntry.EntityKey, typeof(TEntity), existingEntry.WrappedEntity.IdentityType); 213result = existingEntry.WrappedEntity; 333targetEntry.WrappedEntity, 378targetEntry.WrappedEntity, 749if (clrType != existingEntry.WrappedEntity.IdentityType) 751throw EntityUtil.RecyclingEntity(existingEntry.EntityKey, clrType, existingEntry.WrappedEntity.IdentityType);
System\Data\Objects\DataClasses\EntityReference.cs (2)
220this.ReferenceValue = targetEntry.WrappedEntity; 238EntityKey ownerKey = ValidateOwnerWithRIConstraints(targetEntry == null ? null : targetEntry.WrappedEntity, value, checkBothEnds: true);
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (1)
319IEntityWrapper wrappedTarget = existingEntry.WrappedEntity;
System\Data\Objects\EntityEntry.cs (27)
91(WrappedEntity.IdentityType != Entity.GetType() && 523if (WrappedEntity.Entity == null) 527return WrappedEntity.RelationshipManager; 1131RelatedEnd relatedEnd = this.WrappedEntity.RelationshipManager.GetRelatedEndInternal(relationshipName, targetRoleName); 1602if (WrappedEntity.IdentityType != Entity.GetType() && // Is a proxy 1607_cache.EntityInvokingFKSetter = WrappedEntity.Entity; 2107var principal = WrappedEntity.GetNavigationPropertyValue(reference); 2115reference.UpdateForeignKeyValues(WrappedEntity, ((EntityEntry)principalEntry).WrappedEntity, changedFKs, forceChange: false); 2138object val = this.WrappedEntity.GetNavigationPropertyValue(relatedEnd); 2257RelatedEnd relatedEnd = this.WrappedEntity.RelationshipManager.GetRelatedEndInternal(n.RelationshipType.FullName, n.ToEndMember.Name); 2260object val = this.WrappedEntity.GetNavigationPropertyValue(relatedEnd); 2348IEntityWrapper relatedWrapper = relatedEntry.WrappedEntity; ; 2352EntityKey permanentKeyOwner = this.ObjectStateManager.GetPermanentKey(relatedEntry.WrappedEntity, relatedEndTo, this.WrappedEntity); 2541EntityReference relatedEnd = WrappedEntity.RelationshipManager.GetRelatedEndInternal( 3061this.WrappedEntity.RelationshipManager.VerifyIsNotRelated(); 3352if (this.WrappedEntity.IdentityType != wrappedCurrentEntity.IdentityType) 3380if (this.WrappedEntity.IdentityType != wrappedOriginalEntity.IdentityType) 3425EntityReference relatedEnd = WrappedEntity.RelationshipManager.GetRelatedEndInternal( 3547(replaceExistingRef || WillNotRefSteal(relatedEnd, principalEntry.WrappedEntity)) && 3548relatedEnd.CanSetEntityType(principalEntry.WrappedEntity)) 3566EntityReference otherEnd = relatedEnd.GetOtherEndOfRelationship(principalEntry.WrappedEntity) as EntityReference; 3735reference.UpdateForeignKeyValues(this.WrappedEntity, existingPrincipal, changedFKs: null, forceChange: false); 3742reference.UpdateForeignKeyValues(this.WrappedEntity, principalKey); 3754EntityKey principalKey = WrappedEntity.EntityKey; 3787principalRef.UpdateForeignKeyValues(dependent, WrappedEntity, changedFKs: null, forceChange: false);
System\Data\Objects\Internal\EntityWithChangeTrackerStrategy.cs (1)
58bool isProxy = entry.WrappedEntity.IdentityType != _entity.GetType();
System\Data\Objects\Internal\EntityWrapperFactory.cs (1)
242return existingEntry.WrappedEntity;
System\Data\Objects\ObjectContext.cs (1)
968if (ose.WrappedEntity.IdentityType != wrappedOriginalEntity.IdentityType)
System\Data\Objects\ObjectStateManager.cs (41)
730targetEntry.WrappedEntity, 1323targetEntry.WrappedEntity, 1391if (entry.WrappedEntity.Entity != null) 1393EntityReference reference = entry.WrappedEntity.RelationshipManager.GetRelatedEndInternal(((AssociationSet)relationshipEntry.EntitySet).ElementType.FullName, targetRoleName) as EntityReference; 2040PromoteKeyEntry(existingEntry, entry.WrappedEntity, null, true, /*setIsLoaded*/ false, /*keyEntryInitialized*/ false, "AcceptChanges"); 2118EntityKey entityKey = entry.WrappedEntity.EntityKey; 2126entry.WrappedEntity.EntityKey = value; // user will have control 2127EntityUtil.CheckEntityKeysMatch(entry.WrappedEntity, value); 2208RelatedEnd relatedEnd = (RelatedEnd)sourceEntry.WrappedEntity.RelationshipManager.GetRelatedEnd(navigationProperty); 2240RelatedEnd relatedEnd = (RelatedEnd)sourceEntry.WrappedEntity.RelationshipManager.GetRelatedEnd(navigationProperty, throwArgumentException: removedConvert); 2269RelatedEnd relatedEnd = sourceEntry.WrappedEntity.RelationshipManager.GetRelatedEndInternal(relationshipName, targetRoleName); 2326relatedEnd.VerifyType(targetEntry.WrappedEntity); 2357relatedEnd.Add(targetEntry.WrappedEntity, 2367relatedEnd.Add(targetEntry.WrappedEntity, 2722IEntityWrapper wrappedEntity = entry.WrappedEntity; // we have to cache the entity before detaching it totally so we can fire event 2938RemoveEntryFromKeylessStore(entry.WrappedEntity); 3123tm.AddedRelationshipsByGraph.TryGetValue(entry.WrappedEntity, out addedRelationshipsByGraph); 3125tm.AddedRelationshipsByForeignKey.TryGetValue(entry.WrappedEntity, out addedRelationshipsByForeignKey); 3213if (tm.AddedRelationshipsByPrincipalKey.TryGetValue(entry.WrappedEntity, out addedRelationshipsByPrincipalKey)) 3223EntityKey addedKey = GetPermanentKey(entry.WrappedEntity, reference, addedEntity); 3237if (tm.DeletedRelationshipsByForeignKey.TryGetValue(entry.WrappedEntity, out deletedRelationshipsByForeignKey)) 3343foreach (RelatedEnd relatedEnd in entry.WrappedEntity.RelationshipManager.Relationships) 3351tm.AddedRelationshipsByForeignKey.TryGetValue(entry.WrappedEntity, out addedRelationshipsByForeignKey)) 3361if (tm.AddedRelationshipsByGraph.TryGetValue(entry.WrappedEntity, out addedRelationshipsByGraph)) 3378relatedEntry.WrappedEntity.Entity != null) 3387entitiesToAdd.Remove(relatedEntry.WrappedEntity); 3389PerformAdd(entry.WrappedEntity, relatedEnd, relatedEntry.WrappedEntity, true); 3408PerformAdd(entry.WrappedEntity, relatedEnd, entityToAdd, false); 3469foreach (RelatedEnd relatedEnd in entry.WrappedEntity.RelationshipManager.Relationships) 3477tm.DeletedRelationshipsByForeignKey.TryGetValue(entry.WrappedEntity, out deletedRelationshipsByForeignKey)) 3486if (tm.DeletedRelationshipsByGraph.TryGetValue(entry.WrappedEntity, out deletedRelationshipsByGraph)) 3501relatedEntry.WrappedEntity.Entity != null) 3503relatedEntity = relatedEntry.WrappedEntity; 3513relatedEntry.WrappedEntity.Entity != null) 3518relatedEntity = relatedEntry.WrappedEntity; 3531bool preserveForeignKey = ShouldPreserveForeignKeyForDependent(entry.WrappedEntity, relatedEnd, relatedEntity, entitiesToDelete); 3534if (reference != null && IsReparentingReference(entry.WrappedEntity, reference)) 3568bool preserveForeignKey = ShouldPreserveForeignKeyForPrincipal(entry.WrappedEntity, relatedEnd, entityToDelete, entitiesToDelete); 3570if (reference != null && IsReparentingReference(entry.WrappedEntity, reference)) 3692if (entry.WrappedEntity.RequiresRelationshipChangeTracking)
System\Data\Objects\RelationshipEntry.cs (4)
504IEntityWrapper wrappedEntity1 = entry1.WrappedEntity; 506IEntityWrapper wrappedEntity2 = entry2.WrappedEntity; 666relatedEnd.Add(targetEntry.WrappedEntity, 676relatedEnd.Add(targetEntry.WrappedEntity,