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