1 type derived from EntityReference
System.Data.Entity (1)
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (1)
27public sealed class EntityReference<TEntity> : EntityReference
121 references to EntityReference
System.Data.Entity (118)
System\Data\Common\Internal\Materialization\Shaper.cs (2)
510EntityReference reference = relatedEnd as EntityReference;
System\Data\Objects\DataClasses\EntityCollection.cs (2)
422EntityReference otherEnd = GetOtherEndOfRelationship(wrappedEntity) as EntityReference;
System\Data\Objects\DataClasses\EntityReference.cs (2)
412EntityReference otherEnd = GetOtherEndOfRelationship(targetEntity) as EntityReference;
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (1)
489((EntityReference)this).DetachedEntityKey = null;
System\Data\Objects\DataClasses\RelatedEnd.cs (26)
558EntityReference reference = this as EntityReference; 882EntityEntry targetEntry = stateManager.FindEntityEntry(((EntityReference)targetRelatedEnd).WrappedOwner.Entity); 1341Debug.Assert(this is EntityReference, "Dependent end cannot be a collection."); 1342((EntityReference)this).UpdateForeignKeyValues(_wrappedOwner, wrappedTarget, changedFKs: null, forceChange: forceForeignKeyChanges); 1346Debug.Assert(targetRelatedEnd is EntityReference, "Dependent end cannot be a collection."); 1347((EntityReference)targetRelatedEnd).UpdateForeignKeyValues(wrappedTarget, _wrappedOwner, changedFKs: null, forceChange: forceForeignKeyChanges); 1595EntityReference otherEndAsRef = otherRelatedEnd as EntityReference; 1642EntityReference entityRef = this as EntityReference; 1803((EntityReference)this).DetachedEntityKey != null)) 1810Debug.Assert(this is EntityReference, "Expected reference to principal"); 1821principalKey = ((EntityReference)this).EntityKey; 1825principalKey = ((EntityReference)this).DetachedEntityKey; 1830IEntityWrapper wrappedRelatedEntity = ((EntityReference)this).ReferenceValue; 1848EntityKey detachedKey = ((EntityReference)this).DetachedEntityKey; 1939if (this is EntityReference) 2014EntityReference entityReference = this as EntityReference; 2032EntityReference entityReference = this as EntityReference; 2120EntityReference entityRef = this as EntityReference; 2387EntityReference entityRef = this as EntityReference;
System\Data\Objects\DataClasses\RelationshipManager.cs (6)
1034EntityReference reference = relatedEnd as EntityReference; 1155var dependentEndsToProcess = new List<EntityReference>(); 1165Debug.Assert(dependentEnd is EntityReference, "Dependent end in FK relationship should always be a reference."); 1166dependentEndsToProcess.Add((EntityReference)dependentEnd); 1171foreach (EntityReference dependentEnd in dependentEndsToProcess)
System\Data\Objects\EntityEntry.cs (40)
1133EntityReference reference = relatedEnd as EntityReference; 1713EntityReference reference = pair.Key as EntityReference; 2102var reference = RelationshipManager.GetRelatedEndInternal(dependent.Item1.ElementType.FullName, dependent.Item2.FromRole.Name) as EntityReference; 2221EntityReference otherEndAsRef = otherRelatedEnd as EntityReference; 2325relatedEndTo is EntityReference && 2387if (relatedEnd is EntityReference) 2541EntityReference relatedEnd = WrappedEntity.RelationshipManager.GetRelatedEndInternal( 2542dependent.Item1.ElementType.FullName, dependent.Item2.FromRole.Name) as EntityReference; 2592EntityReference entityReference = (EntityReference)relationshipManager.GetRelatedEndInternal(targetMember.DeclaringType.FullName, targetMember.Name); 3400foreach (EntityReference relatedEnd in FindFKRelatedEnds()) 3425EntityReference relatedEnd = WrappedEntity.RelationshipManager.GetRelatedEndInternal( 3426dependent.Item1.ElementType.FullName, dependent.Item2.FromRole.Name) as EntityReference; 3441internal void FixupEntityReferenceByForeignKey(EntityReference reference) 3519internal void FixupEntityReferenceToPrincipal(EntityReference relatedEnd, EntityKey foreignKey, bool setIsLoaded, bool replaceExistingRef) 3566EntityReference otherEnd = relatedEnd.GetOtherEndOfRelationship(principalEntry.WrappedEntity) as EntityReference; 3611private bool WillNotRefSteal(EntityReference refToPrincipal, IEntityWrapper wrappedPrincipal) 3614EntityReference refToDependent = dependentEnd as EntityReference; 3654EntityReference relatedEnd = (RelatedEnd)RelationshipManager.GetRelatedEnd(principalRole.DeclaringType.FullName, principalRole.Name) as EntityReference; 3702EntityReference reference = RelationshipManager.GetRelatedEndInternal(dependent.Item1.ElementType.FullName, dependent.Item2.FromRole.Name) as EntityReference; 3710(principalEntry != this || (isOneToMany = reference.GetOtherEndOfRelationship(existingPrincipal) is EntityReference).Value)) 3717isOneToMany = reference.GetOtherEndOfRelationship(existingPrincipal) is EntityReference; 3782EntityReference principalRef = principalEnd.GetOtherEndOfRelationship(dependent) as EntityReference; 3862EntityReference reference = RelationshipManager.GetRelatedEndInternal( 3863associationSet.ElementType.FullName, constraint.FromRole.Name) as EntityReference; 3882internal IEnumerable<EntityReference> FindFKRelatedEnds() 3884HashSet<EntityReference> relatedEnds = new HashSet<EntityReference>(); 3888EntityReference reference = RelationshipManager.GetRelatedEndInternal( 3889dependent.Item1.ElementType.FullName, dependent.Item2.FromRole.Name) as EntityReference; 3912foreach (EntityReference entityReference in this.FindFKRelatedEnds())
System\Data\Objects\Internal\TransactionManager.cs (8)
40internal HashSet<EntityReference> PopulatedEntityReferences 47internal HashSet<EntityReference> AlignedEntityReferences 200internal EntityReference RelationshipBeingUpdated 224this.PopulatedEntityReferences = new HashSet<EntityReference>(); 225this.AlignedEntityReferences = new HashSet<EntityReference>(); 263this.PopulatedEntityReferences = new HashSet<EntityReference>(); 264this.AlignedEntityReferences = new HashSet<EntityReference>(); 376internal void BeginForeignKeyUpdate(EntityReference relationship)
System\Data\Objects\ObjectStateManager.cs (29)
616EntityReference reference = end as EntityReference; 817Debug.Assert(relatedEnd is EntityReference, "If end is not Many multiplicity, then the RelatedEnd should be an EntityReference."); 818var relatedReference = (EntityReference)relatedEnd; 945((EntityReference)relatedEnd).DetachedEntityKey = targetKey; 1393EntityReference reference = entry.WrappedEntity.RelationshipManager.GetRelatedEndInternal(((AssociationSet)relationshipEntry.EntitySet).ElementType.FullName, targetRoleName) as EntityReference; 3153EntityReference reference = pair.Key as EntityReference; 3188EntityReference reference = pair.Key as EntityReference; 3350if (relatedEnd is EntityReference && 3395EntityReference reference = relatedEnd as EntityReference; 3430EntityReference targetReference = relatedEnd.GetOtherEndOfRelationship(entityToAdd) as EntityReference; 3438EntityReference reference = relatedEnd as EntityReference; 3476if (relatedEnd is EntityReference && 3479deletedRelationshipsByForeignKey.TryGetValue(relatedEnd as EntityReference, out entityKeysOfDeletedObjects); 3499EntityReference reference = relatedEnd as EntityReference; 3569EntityReference reference = relatedEnd as EntityReference; 3633hasReferenceRemove && !HasAddedReference(entity, relatedEnd as EntityReference)); 3636private bool HasAddedReference(IEntityWrapper wrappedOwner, EntityReference reference) 3650private bool IsReparentingReference(IEntityWrapper wrappedEntity, EntityReference reference) 3659reference.GetOtherEndOfRelationship(wrappedEntity) as EntityReference;
System\Data\Objects\RelationshipEntry.cs (2)
544EntityReference entityReference = (EntityReference)relationshipManager.GetRelatedEndInternal(targetMember.DeclaringType.FullName, targetMember.Name);
System.Data.Services (3)
System\Data\Services\Providers\ObjectContextServiceProvider.cs (3)
2431((EntityReference)relatedEnd).EntityKey = null; 2435EntityKey key = ((EntityReference)relatedEnd).EntityKey; 2447((EntityReference)relatedEnd).EntityKey = null;