2 writes to _cache
System.Data.Entity (2)
System\Data\Objects\ObjectStateEntry.cs (2)
45_cache = cache; 346_cache = null;
118 references to _cache
System.Data.Entity (118)
System\Data\Objects\EntityEntry.cs (102)
219_cache.ChangeState(this, EntityState.Unchanged, State); 438if (_cache != null) 440_cache.ChangeState(this, EntityState.Deleted, EntityState.Detached); 457_cache.FixupKey(this); 475_cache.ChangeState(this, EntityState.Modified, EntityState.Unchanged); 480_cache.FixupReferencesByForeignKeys(this); 505_cache.ChangeState(this, EntityState.Unchanged, State); 903Debug.Assert(_cache != null, "Cannot Reset an entity that is not currently attached to a context."); 905_cache.ForgetEntryWithConceptualNull(this, resetAllKeys: true); 941_cache.ChangeState(this, EntityState.Deleted, State); 951foreach (RelationshipEntry entry in _cache.CopyOfRelationshipsByKey(EntityKey)) 1081if ((changingObject != _cache.ChangingObject) || 1082(changingMemberName != _cache.ChangingMember) || 1083(entityMemberName != _cache.ChangingEntityMember)) 1091if (this.State != _cache.ChangingState) 1093throw EntityUtil.ChangedInDifferentStateFromChanging(this.State, _cache.ChangingState); 1096object oldValue = _cache.ChangingOldValue; 1099if (_cache.SaveOriginalValues) 1163if (_cache != null && !_cache.TransactionManager.IsOriginalValuesGetter) 1176_cache.ChangeState(this, initialState, this.State); 1182Debug.Assert(_cache != null, "Unexpected null state manager."); 1226newValue = _cache.ComplexTypeMaterializer.CreateComplex(newValueRecord, newValueRecord.DataRecordInfo, null); 1280_cache.SaveOriginalValues = (State == EntityState.Unchanged || State == EntityState.Modified) && 1344_cache.GetOrAddStateManagerTypeMetadata(member.CdmMetadata.TypeUsage.EdmType), retValue); 1348_cache.GetOrAddStateManagerTypeMetadata(member.CdmMetadata.TypeUsage.EdmType), retValue); 1352_cache.GetOrAddStateManagerTypeMetadata(member.CdmMetadata.TypeUsage.EdmType), retValue); 1356_cache.GetOrAddStateManagerTypeMetadata(member.CdmMetadata.TypeUsage.EdmType), retValue, parentEntityPropertyIndex); 1424return _cache.GetEntityEntry(relationshipEntry.RelationshipWrapper.GetOtherEntityKey(this.EntityKey)); 1448StateManagerTypeMetadata typeMetadata = _cache.GetOrAddStateManagerTypeMetadata(memberMetadata.CdmMetadata.TypeUsage.EdmType); 1548if (!_cache.InRelationshipFixup) 1587tmpTypeMetadata = _cache.GetOrAddStateManagerTypeMetadata(complexObject.GetType(), (EntitySet)this.EntitySet); 1607_cache.EntityInvokingFKSetter = WrappedEntity.Entity; 1625_cache.ChangingEntityMember = entityMemberName; 1626_cache.ChangingObject = changingObject; 1627_cache.ChangingMember = changingMember; 1628_cache.ChangingState = changingState; 1629_cache.ChangingOldValue = oldValue; 1632_cache.SaveOriginalValues = false; 1659if (!this._cache.TransactionManager.IsAttachTracking || 1660this._cache.TransactionManager.OriginalMergeOption != MergeOption.NoTracking) 1733StateManagerTypeMetadata typeMetadata = _cache.GetOrAddStateManagerTypeMetadata(member.CdmMetadata.TypeUsage.EdmType); 1840Debug.Assert(_cache.SaveOriginalValues, "complex object instance was changed so the SaveOriginalValues flag should be set to true"); 1846_cache.ChangingOldValue = oldComplexValue; 1944StateManagerTypeMetadata metadata = _cache.GetOrAddStateManagerTypeMetadata(complexMember.CdmMetadata.TypeUsage.EdmType); 1972_cache.ChangingOldValue = oldNestedComplexValue; 2057StateManagerTypeMetadata typeMetadata = _cache.GetOrAddStateManagerTypeMetadata(member.CdmMetadata.TypeUsage.EdmType); 2111if (_cache.TryGetObjectStateEntry(principal, out principalEntry) && 2423_cache.TransactionManager.BeginDetaching(); 2436_cache.TransactionManager.EndDetaching(); 2463_cache.ChangeState(this, this.State, EntityState.Detached); 2495_cache.ChangeState(this, EntityState.Added, EntityState.Detached); 2509_cache.ChangeState(this, EntityState.Modified, EntityState.Deleted); 2523_cache.ChangeState(this, EntityState.Unchanged, EntityState.Deleted); 2550foreach (RelationshipEntry relationshipEntry in _cache.FindRelationshipsByKey(EntityKey)) 2557EntityEntry relatedEntry = _cache.GetEntityEntry(targetKey); 2576foreach (RelationshipEntry relationshipEntry in _cache.CopyOfRelationshipsByKey(EntityKey)) 2582EntityEntry relatedEntry = _cache.GetEntityEntry(targetKey); 2637foreach (RelationshipEntry relationshipEntry in _cache.CopyOfRelationshipsByKey(EntityKey)) 2652EntityEntry relatedEntry = _cache.GetEntityEntry(entityKey); 2716foreach (RelationshipEntry relationshipEntry in _cache.FindRelationshipsByKey(EntityKey)) 2788foreach (RelationshipEntry relationshipEntry in _cache.FindRelationshipsByKey(EntityKey)) 2888_cache.ChangeState(this, this.State, EntityState.Unchanged); 2892_cache.RemoveEntryFromKeylessStore(_wrappedEntity); 2901_cache.OnObjectStateManagerChanged(CollectionChangeAction.Remove, degradedEntity); 3029newValue = _cache.ComplexTypeMaterializer.CreateComplex(newValueRecord, newValueRecord.DataRecordInfo, null); 3037foreach (RelationshipEntry relationshipEntry in _cache.CopyOfRelationshipsByKey(this.EntityKey)) 3097_cache.ForgetEntryWithConceptualNull(this, resetAllKeys: true); 3190_cache.FixupReferencesByForeignKeys(this); // Make sure refs based on FK values are set 3191_cache.OnObjectStateManagerChanged(CollectionChangeAction.Add, Entity); 3205_cache.FixupReferencesByForeignKeys(this); // Make sure refs based on FK values are set 3206_cache.OnObjectStateManagerChanged(CollectionChangeAction.Add, Entity); 3218_cache.FixupReferencesByForeignKeys(this); // Make sure refs based on FK values are set 3219_cache.OnObjectStateManagerChanged(CollectionChangeAction.Add, Entity); 3338(_cache.EntryHasConceptualNull(this) && _modifiedFields != null && _modifiedFields[propertyIndex]); 3404_cache.RemoveEntryFromForeignKeyIndex(foreignKey, this); 3407_cache.AssertEntryDoesNotExistInForeignKeyIndex(this); 3418Debug.Assert(_cache != null, "Attempt to fixup detached entity entry"); 3419_cache.TransactionManager.BeginGraphUpdate(); 3420bool setIsLoaded = !(_cache.TransactionManager.IsAttachTracking || _cache.TransactionManager.IsAddTracking); 3437_cache.TransactionManager.EndGraphUpdate(); 3479if (_cache.TransactionManager.RelationshipBeingUpdated != reference) 3483ObjectStateManager stateManager = _cache; 3484_cache.TransactionManager.BeginGraphUpdate(); 3490_cache.TransactionManager.EntityBeingReparented = Entity; 3498Debug.Assert(_cache != null, "Unexpected null state manager."); 3499_cache.TransactionManager.EntityBeingReparented = null; 3500_cache.TransactionManager.EndGraphUpdate(); 3529bool canModifyReference = _cache.TransactionManager.RelationshipBeingUpdated != relatedEnd && 3530(!_cache.TransactionManager.IsForeignKeyUpdate || 3544if (_cache.TryGetEntityEntry(foreignKey, out principalEntry) && 3554if (_cache.TransactionManager.PopulatedEntityReferences != null) 3556Debug.Assert(_cache.TransactionManager.IsAddTracking || _cache.TransactionManager.IsAttachTracking, 3558_cache.TransactionManager.PopulatedEntityReferences.Add(relatedEnd); 3564if (_cache.TransactionManager.PopulatedEntityReferences != null) 3569_cache.TransactionManager.PopulatedEntityReferences.Add(otherEnd); 3581_cache.AddEntryContainingForeignKeyToIndex(foreignKey, this); 3672Debug.Assert(_cache != null, "Attempt to fixup detached entity entry"); 3673_cache.TransactionManager.BeginFixupKeysByReference(); 3680_cache.TransactionManager.EndFixupKeysByReference();
System\Data\Objects\ObjectStateEntry.cs (2)
62return _cache; 357Debug.Assert(null != _cache, "null ObjectStateManager");
System\Data\Objects\ObjectStateManager.cs (1)
519Debug.Assert(entry._cache != null, "found an entry in the _danglingForeignKeys collection that has been nulled out");
System\Data\Objects\RelationshipEntry.cs (13)
74if (_cache != null) 76_cache.ChangeState(this, EntityState.Deleted, EntityState.Detached); 80_cache.ChangeState(this, EntityState.Added, EntityState.Unchanged); 320_cache.ChangeState(this, EntityState.Deleted, State); 466EntityEntry relatedEntry = _cache.GetEntityEntry(entityKey); 472foreach (RelationshipEntry relationshipEntry in _cache.FindRelationshipsByKey(entityKey)) 484_cache.DeleteKeyEntry(relatedEntry); 503EntityEntry entry1 = _cache.GetEntityEntry((EntityKey)GetCurrentRelationValue(0)); 505EntityEntry entry2 = _cache.GetEntityEntry((EntityKey)GetCurrentRelationValue(1)); 561_cache.ChangeState(this, this.State, EntityState.Deleted); 584_cache.ChangeState(this, EntityState.Unchanged, EntityState.Deleted); 600if (_cache != null) 602_cache.ChangeState(this, this.State, EntityState.Detached);