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