Base:
property
EntityKey
System.Data.Objects.ObjectStateEntry.EntityKey
1 write to EntityKey
System.Data.Entity (1)
System\Data\Objects\ObjectStateManager.cs (1)
2135
entry.
EntityKey
= value;
88 references to EntityKey
System.Data.Entity (88)
System\Data\Common\Internal\Materialization\Shaper.cs (6)
155
Debug.Assert(existingEntry.
EntityKey
.Equals(entityKey), "Found ObjectStateEntry with wrong EntityKey");
203
Debug.Assert(existingEntry.
EntityKey
.Equals(entityKey), "Found ObjectStateEntry with wrong EntityKey");
206
throw EntityUtil.RecyclingEntity(existingEntry.
EntityKey
, typeof(TEntity), existingEntry.WrappedEntity.IdentityType);
211
throw EntityUtil.AddedEntityAlreadyExists(existingEntry.
EntityKey
);
751
throw EntityUtil.RecyclingEntity(existingEntry.
EntityKey
, clrType, existingEntry.WrappedEntity.IdentityType);
756
throw EntityUtil.AddedEntityAlreadyExists(existingEntry.
EntityKey
);
System\Data\Objects\DataClasses\RelatedEnd.cs (4)
870
if (!VerifyRIConstraintsWithRelatedEntry(constraint, ownerEntry.GetCurrentEntityValue, collection[0].ObjectStateEntry.
EntityKey
))
884
if (!VerifyRIConstraintsWithRelatedEntry(constraint, targetEntry.GetCurrentEntityValue, ownerEntry.
EntityKey
))
1859
if (!VerifyRIConstraintsWithRelatedEntry(constraint, detachedKey.FindValueByName, ownerEntry.
EntityKey
))
1874
if (!VerifyRIConstraintsWithRelatedEntry(constraint, dependent.GetCurrentEntityValue, ownerEntry.
EntityKey
))
System\Data\Objects\EntityEntry.cs (34)
629
item.SetNextRelationshipEnd(this.
EntityKey
, _headRelationshipEnds);
645
current = current.GetNextRelationshipEnd(
EntityKey
))
664
Debug.Assert(
EntityKey
.Equals(item.RelationshipWrapper.Key0) ||
EntityKey
.Equals(item.RelationshipWrapper.Key1), "entity key doesn't match");
673
bool currentIsKey0 = object.ReferenceEquals(this.
EntityKey
, current.Key0) ||
674
(!object.ReferenceEquals(this.
EntityKey
, current.Key1) && this.
EntityKey
.Equals(current.Key0));
680
Debug.Assert(
EntityKey
.Equals(current.RelationshipWrapper.Key0), "entity key didn't match");
686
Debug.Assert(
EntityKey
.Equals(current.RelationshipWrapper.Key1), "entity key didn't match");
736
current.ChangeRelatedEnd(oldKey,
EntityKey
);
805
Debug.Assert(_entityEntry.
EntityKey
.Equals(relationshipEnd.Key0) || _entityEntry.
EntityKey
.Equals(relationshipEnd.Key1), "entity key mismatch");
808
relationshipEnd = relationshipEnd.GetNextRelationshipEnd(_entityEntry.
EntityKey
);
858
_current = _current.GetNextRelationshipEnd(_entityEntry.
EntityKey
);
951
foreach (RelationshipEntry entry in _cache.CopyOfRelationshipsByKey(
EntityKey
))
1409
Debug.Assert((object)this.
EntityKey
!= null, "entry should have a not null EntityKey");
1413
AssociationEndMember endMember = relationshipEntry.RelationshipWrapper.GetAssociationEndMember(
EntityKey
);
1422
Debug.Assert((object)this.
EntityKey
!= null, "entry should have a not null EntityKey");
1424
return _cache.GetEntityEntry(relationshipEntry.RelationshipWrapper.GetOtherEntityKey(this.
EntityKey
));
2213
if (!RelatedEnd.VerifyRIConstraintsWithRelatedEntry(constraint, dependentEntry.GetCurrentEntityValue, principalEntry.
EntityKey
))
2550
foreach (RelationshipEntry relationshipEntry in _cache.FindRelationshipsByKey(
EntityKey
))
2556
EntityKey targetKey = relationshipEntry.RelationshipWrapper.GetOtherEntityKey(
EntityKey
);
2576
foreach (RelationshipEntry relationshipEntry in _cache.CopyOfRelationshipsByKey(
EntityKey
))
2579
EntityKey targetKey = relationshipEntry.RelationshipWrapper.GetOtherEntityKey(
EntityKey
);
2637
foreach (RelationshipEntry relationshipEntry in _cache.CopyOfRelationshipsByKey(
EntityKey
))
2716
foreach (RelationshipEntry relationshipEntry in _cache.FindRelationshipsByKey(
EntityKey
))
2735
Debug.Assert(!otherEnd.
EntityKey
.IsTemporary, "key of key entry can't be temporary");
2736
IList<EntityKeyMember> otherEndKeyValues = otherEnd.
EntityKey
.EntityKeyValues;
2788
foreach (RelationshipEntry relationshipEntry in _cache.FindRelationshipsByKey(
EntityKey
))
2808
Debug.Assert(!otherEnd.
EntityKey
.IsTemporary, "key of Unchanged or Modified entry can't be temporary");
2809
IList<EntityKeyMember> otherEndKeyValues = otherEnd.
EntityKey
.EntityKeyValues;
2869
_entityKey =
EntityKey
; //Performs validation.
3037
foreach (RelationshipEntry relationshipEntry in _cache.CopyOfRelationshipsByKey(this.
EntityKey
))
3662
principalKey = relatedEnd.EntityKey ?? relatedEnd.CachedValue.ObjectStateEntry.
EntityKey
;
System\Data\Objects\ObjectContext.cs (2)
535
EntityKey key = existingEntry != null ? existingEntry.
EntityKey
: wrappedEntity.GetEntityKeyFromEntity();
669
if (entry != null && entry.
EntityKey
.IsTemporary)
System\Data\Objects\ObjectStateManager.cs (40)
432
Debug.Assert(entityKey == newEntry.
EntityKey
, "The key on the new entry was not set correctly");
468
foreach (EntityEntry foundEntry in GetNonFixedupEntriesContainingForeignKey(newEntry.
EntityKey
))
473
RemoveForeignKeyFromIndex(newEntry.
EntityKey
);
500
Debug.Assert(dFkEntry.
EntityKey
== null || entry.
EntityKey
== null ||
501
(dFkEntry.
EntityKey
!= entry.
EntityKey
&& dFkEntry != entry),
502
string.Format(CultureInfo.InvariantCulture, "The entry references {0} equal. dFkEntry={1}, entry={2}", dFkEntry == entry ? "are" : "are not", dFkEntry.
EntityKey
.ConcatKeyValue(), entry.
EntityKey
.ConcatKeyValue()));
520
Debug.Assert(validEntries.Contains(entry), "The entry in the dangling foreign key store is no longer in the ObjectStateManager. Key=" + (entry.State == EntityState.Detached ? "detached" : entry.
EntityKey
!= null ? "null" : entry.
EntityKey
.ConcatKeyValue()));
521
Debug.Assert(entry.State == EntityState.Detached || !ForeignKeyFactory.IsConceptualNullKey(entry.
EntityKey
), "Found an entry with conceptual null Key=" + entry.
EntityKey
.ConcatKeyValue());
714
foreach (RelationshipEntry relationshipEntry in CopyOfRelationshipsByKey(keyEntry.
EntityKey
))
1435
Debug.Assert(entityKey == newEntry.
EntityKey
, "newEntry.EntityKey should match entityKey");
1575
Debug.Assert(key.Equals(entry.
EntityKey
), "EntityKey mismatch");
1601
Debug.Assert(key.Equals(entry.
EntityKey
), "EntityKey mismatch");
1693
result = _addedEntityStore.TryGetValue(entry.
EntityKey
, out entrya);
1697
result |= _modifiedEntityStore.TryGetValue(entry.
EntityKey
, out entrya);
1701
result |= _deletedEntityStore.TryGetValue(entry.
EntityKey
, out entrya);
1705
result |= _unchangedEntityStore.TryGetValue(entry.
EntityKey
, out entrya);
1963
EntityKey oldKey = entry.
EntityKey
;
2000
newKey = existingEntry.
EntityKey
; // reuse existing reference
2039
Debug.Assert(Object.ReferenceEquals(newKey, existingEntry.
EntityKey
), "should be same key reference");
2072
EntityKey oldKey = entry.
EntityKey
;
2114
Debug.Assert((object)entry.
EntityKey
!= null, "Cannot reset an entry's key if it hasn't been set in the first place.");
2116
Debug.Assert(!entry.
EntityKey
.Equals(value), "the keys should not be equal");
2138
Debug.Assert(value == entry.
EntityKey
, "The new key was not set onto the entry correctly");
2283
new KeyValuePair<string, EntityKey>(relatedEnd.SourceRoleName, sourceEntry.
EntityKey
),
2284
new KeyValuePair<string, EntityKey>(relatedEnd.TargetRoleName, targetEntry.
EntityKey
));
2713
Debug.Assert((object)entry.
EntityKey
!= null, "attached entry must have a key");
2714
foreach (RelationshipEntry relationshipEntry in CopyOfRelationshipsByKey(entry.
EntityKey
))
2793
Debug.Assert(null != (object)entry.
EntityKey
, "missing EntityKey");
2809
Debug.Assert(!entry.
EntityKey
.IsTemporary, "adding temporary entity key into Unchanged state");
2817
Debug.Assert(entry.
EntityKey
.IsTemporary, "adding non-temporary entity key into Added state");
2825
Debug.Assert(!entry.
EntityKey
.IsTemporary, "adding temporary entity key into Deleted state");
2833
Debug.Assert(!entry.
EntityKey
.IsTemporary, "adding temporary entity key into Modified state");
2842
dictionaryToAdd.Add(entry.
EntityKey
, entry);
2936
bool result = dictionaryContainingEntry.Remove(entry.
EntityKey
);
3292
entityKey = entityTo.ObjectStateEntry.
EntityKey
;
System\Data\Objects\RelationshipEntry.cs (2)
528
targetKey = entry1.
EntityKey
;
533
targetKey = entry2.
EntityKey
;