165 references to ObjectStateManager
System.Data.Entity (157)
System\Data\Common\Internal\Materialization\Shaper.cs (11)
152EntityEntry existingEntry = this.Context.ObjectStateManager.FindEntityEntry(entityKey); 164Context.ObjectStateManager.AddEntry(wrappedEntity, entityKey, entitySet, "HandleEntity", false); 168Context.ObjectStateManager.PromoteKeyEntry(existingEntry, wrappedEntity, (IExtendedDataRecord)null, false, /*setIsLoaded*/ true, /*keyEntryInitialized*/ false, "HandleEntity"); 200EntityEntry existingEntry = this.Context.ObjectStateManager.FindEntityEntry(entityKey); 222Context.ObjectStateManager.AddEntry(result, entityKey, entitySet, "HandleEntity", false); 226Context.ObjectStateManager.PromoteKeyEntry(existingEntry, result, (IExtendedDataRecord)null, false, /*setIsLoaded*/ true, /*keyEntryInitialized*/ false, "HandleEntity"); 306ObjectStateManager manager = Context.ObjectStateManager; 771Context.ObjectStateManager.ForgetEntryWithConceptualNull(existingEntry, resetAllKeys: true); 773Context.ObjectStateManager.FixupReferencesByForeignKeys(existingEntry, replaceAddedRefs: true); 782Context.ObjectStateManager.ForgetEntryWithConceptualNull(existingEntry, resetAllKeys: true); 784Context.ObjectStateManager.FixupReferencesByForeignKeys(existingEntry, replaceAddedRefs: true);
System\Data\Objects\DataClasses\EntityCollection.cs (1)
417TransactionManager tm = ObjectContext.ObjectStateManager.TransactionManager;
System\Data\Objects\DataClasses\EntityReference.cs (7)
131foreach (RelationshipEntry relationshipEntry in this.ObjectContext.ObjectStateManager.FindRelationshipsByKey(ownerKey)) 203ObjectStateManager manager = this.ObjectContext.ObjectStateManager; 356if (this.ObjectContext != null && this.ObjectContext.ObjectStateManager != null && // are we attached? 361this.ObjectContext.ObjectStateManager.RemoveEntryFromForeignKeyIndex(_cachedForeignKey, source); 473ObjectStateManager stateManager = ObjectContext.ObjectStateManager; 574ObjectStateManager stateManager = ObjectContext.ObjectStateManager; 632ObjectStateManager stateManager = ObjectContext.ObjectStateManager;
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (8)
117context.ObjectStateManager.TransactionManager.EntityBeingReparented = GetDependentEndOfReferentialConstraint(value.Entity); 127context.ObjectStateManager.TransactionManager.EntityBeingReparented = null; 282ObjectStateManager manager = this.ObjectContext.ObjectStateManager; 304foreach (RelationshipEntry relationshipEntry in this.ObjectContext.ObjectStateManager.FindRelationshipsByKey(DetachedEntityKey)) 380TransactionManager transManager = ObjectContext.ObjectStateManager.TransactionManager; 436RelationshipEntry relationshipEntry = this.ObjectContext.ObjectStateManager.FindRelationship(RelationshipSet, 477EntityEntry ownerEntry = WrappedOwner.Context.ObjectStateManager.GetEntityEntry(WrappedOwner.Entity); 766TransactionManager tm = ObjectContext != null ? ObjectContext.ObjectStateManager.TransactionManager : null;
System\Data\Objects\DataClasses\RelatedEnd.cs (45)
336EntityEntry stateEntry = _context.ObjectStateManager.FindEntityEntry(_wrappedOwner.Entity); 611StateManagerTypeMetadata metaType = _context.ObjectStateManager.GetOrAddStateManagerTypeMetadata(member.DeclaringType); 674EntityEntry entry = ObjectContext.ObjectStateManager.FindEntityEntry(_wrappedOwner.Entity); 864ObjectStateManager stateManager = ObjectContext.ObjectStateManager; 909EntityEntry stateEntry = this.ObjectContext.ObjectStateManager.GetEntityEntry(_wrappedOwner.Entity); 939EntityEntry stateEntry = ObjectContext.ObjectStateManager.FindEntityEntry(wrappedEntity.Entity); 1116EntityEntry entry = this.ObjectContext.ObjectStateManager.FindEntityEntry(wrappedEntity.Entity); 1235if (!this.ObjectContext.ObjectStateManager.TransactionManager.IsLocalPublicAPI && 1248(this.ObjectContext.ObjectStateManager.TransactionManager.IsAddTracking || 1249this.ObjectContext.ObjectStateManager.TransactionManager.IsAttachTracking || 1250this.ObjectContext.ObjectStateManager.TransactionManager.IsDetectChanges)) 1272TransactionManager transManager = attachedRelatedEnd.WrappedOwner.Context.ObjectStateManager.TransactionManager; 1281if (attachedRelatedEnd.WrappedOwner.Context.ObjectStateManager.TransactionManager.TrackProcessedEntities) 1284if (!attachedRelatedEnd.WrappedOwner.Context.ObjectStateManager.TransactionManager.WrappedEntities.ContainsKey(entityToAdd.Entity)) 1286attachedRelatedEnd.WrappedOwner.Context.ObjectStateManager.TransactionManager.WrappedEntities.Add(entityToAdd.Entity, entityToAdd); 1288attachedRelatedEnd.WrappedOwner.Context.ObjectStateManager.TransactionManager.ProcessedEntities.Add(attachedRelatedEnd.WrappedOwner); 1310attachedRelatedEnd.WrappedOwner.Context.ObjectStateManager.DegradePromotedRelationships(); 1327attachedRelatedEnd.WrappedOwner.Context.ObjectStateManager.TransactionManager.EndAddTracking(); 1335!this.ObjectContext.ObjectStateManager.TransactionManager.IsGraphUpdate) 1377EntityEntry entry = _context.ObjectStateManager.GetEntityEntry(wrappedEntity.Entity); 1448if (_context == null || !_context.ObjectStateManager.TransactionManager.IsLocalPublicAPI) 1457!ReferenceEquals(wrappedEntity.Entity, _context.ObjectStateManager.TransactionManager.EntityBeingReparented) && 1458!ReferenceEquals(_context.ObjectStateManager.EntityInvokingFKSetter, wrappedEntity.Entity)) 1575EntityEntry cacheEntry = _context.ObjectStateManager.FindEntityEntry(wrappedEntity.Entity); 1605ObjectContext.ObjectStateManager.TransactionManager.IsAddTracking && 1683EntityEntry entry = this.ObjectContext.ObjectStateManager.GetEntityEntry(wrappedEntity.Entity); 1725TransactionManager tm = wrapper.Context.ObjectStateManager.TransactionManager; 1728wrapper.Context.ObjectStateManager.TrackPromotedRelationship(this, wrapper); 1751if (!_context.ObjectStateManager.TransactionManager.TrackProcessedEntities || 1752!(_context.ObjectStateManager.TransactionManager.IsAttachTracking || _context.ObjectStateManager.TransactionManager.IsAddTracking) || 1753_context.ObjectStateManager.TransactionManager.ProcessedEntities.Contains(wrappedEntity)) 1756EntityEntry cacheEntry = _context.ObjectStateManager.FindEntityEntry(wrappedEntity.Entity); 1785return this._context.ObjectStateManager.FindRelationship(_relationshipSet, 1818!(this.ObjectContext.ObjectStateManager.TransactionManager.IsAddTracking || 1819this.ObjectContext.ObjectStateManager.TransactionManager.IsAttachTracking)) 1904principalKey = _context.ObjectStateManager.CreateEntityKey(principalEntitySet, wrappedRelatedEntity.Entity); 2159return this.ObjectContext.ObjectStateManager.AddRelation( 2184wrappedEntity.Context.ObjectStateManager.TransactionManager.IsAttachTracking && 2185wrappedEntity.Context.ObjectStateManager.TransactionManager.PromotedKeyEntries.TryGetValue(wrappedEntity.Entity, out entry)) 2227entry = wrappedEntity.Context.ObjectStateManager.FindEntityEntry(wrappedEntity.Entity); 2247entry = wrappedEntity.Context.ObjectStateManager.DeleteRelationship(relationshipSet, 2261RelationshipEntry entry = wrappedEntity.Context.ObjectStateManager.FindRelationship(relationshipSet, 2451this.ObjectContext.ObjectStateManager.TransactionManager.IsAttachTracking && 2452this.ObjectContext.ObjectStateManager.TransactionManager.OriginalMergeOption == MergeOption.NoTracking)
System\Data\Objects\DataClasses\RelationshipManager.cs (5)
1078Debug.Assert(wrappedOwner.Context != null && wrappedOwner.Context.ObjectStateManager != null, "Null context or ObjectStateManager"); 1080TransactionManager transManager = wrappedOwner.Context.ObjectStateManager.TransactionManager; 1087wrappedOwner.Context.ObjectStateManager.DegradePromotedRelationships(); 1271EntityEntry entry = wrappedOwner.Context.ObjectStateManager.FindEntityEntry(ownerKey); 1292EntityEntry entry = wrappedOwner.Context.ObjectStateManager.FindEntityEntry(ownerKey);
System\Data\Objects\Internal\BaseEntityWrapper.cs (2)
179Context.ObjectStateManager.TransactionManager.IsAttachTracking && 180Context.ObjectStateManager.TransactionManager.OriginalMergeOption == MergeOption.NoTracking)
System\Data\Objects\Internal\EntityProxyFactory.cs (1)
531wrappedEntity.Context.ObjectStateManager.EntityInvokingFKSetter = null;
System\Data\Objects\Internal\EntityWrapperFactory.cs (3)
187return WrapEntityUsingStateManagerGettingEntry(entity, context == null ? null : context.ObjectStateManager, out existingEntry); 200return WrapEntityUsingStateManagerGettingEntry(entity, context == null ? null : context.ObjectStateManager, out existingEntry); 301wrapper.EntityKey = context.ObjectStateManager.CreateEntityKey(entitySet, wrapper.Entity);
System\Data\Objects\ObjectContext.cs (62)
488ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 490if (ObjectStateManager.SomeEntryWithConceptualNullExists()) 499foreach (ObjectStateEntry entry in ObjectStateManager.GetObjectStateEntries(EntityState.Deleted)) 504foreach (ObjectStateEntry entry in ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Modified)) 509ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 564key = this.ObjectStateManager.CreateEntityKey(entitySet, wrappedEntity.Entity); 566existingEntry = this.ObjectStateManager.FindEntityEntry(key); 612ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 643System.Data.Objects.Internal.TransactionManager transManager = ObjectStateManager.TransactionManager; 668EntityEntry entry = this.ObjectStateManager.FindEntityEntry(wrappedEntity.Entity); 686ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 712EntityEntry entry = this.ObjectStateManager.AddEntry(wrappedEntity, (EntityKey)null, entitySet, argumentName, true); 725Debug.Assert(this.ObjectStateManager.TransactionManager.TrackProcessedEntities, "Expected tracking processed entities to be true when adding."); 726Debug.Assert(this.ObjectStateManager.TransactionManager.ProcessedEntities != null, "Expected non-null collection when flag set."); 728this.ObjectStateManager.TransactionManager.ProcessedEntities.Add(wrappedEntity); 906key = this.ObjectStateManager.CreateEntityKey(entitySet, currentEntity); 910EntityEntry ose = this.ObjectStateManager.FindEntityEntry(key); 951key = this.ObjectStateManager.CreateEntityKey(entitySet, originalEntity); 955EntityEntry ose = this.ObjectStateManager.FindEntityEntry(key); 994ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1024System.Data.Objects.Internal.TransactionManager transManager = ObjectStateManager.TransactionManager; 1029this.ObjectStateManager.TransactionManager.OriginalMergeOption = wrappedEntity.MergeOption; 1068ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1112key = this.ObjectStateManager.CreateEntityKey(entitySet, wrappedEntity.Entity); 1130EntityEntry entry = ObjectStateManager.FindEntityEntry(key); 1143this.ObjectStateManager.PromoteKeyEntryInitialization(this, entry, wrappedEntity, /*shadowValues*/ null, /*replacingEntry*/ false); 1145Debug.Assert(this.ObjectStateManager.TransactionManager.TrackProcessedEntities, "Expected tracking processed entities to be true when adding."); 1146Debug.Assert(this.ObjectStateManager.TransactionManager.ProcessedEntities != null, "Expected non-null collection when flag set."); 1148this.ObjectStateManager.TransactionManager.ProcessedEntities.Add(wrappedEntity); 1152this.ObjectStateManager.PromoteKeyEntry(entry, 1160ObjectStateManager.FixupReferencesByForeignKeys(entry); 1174entry = this.ObjectStateManager.AttachEntry(key, wrappedEntity, entitySet, argumentName); 1176Debug.Assert(this.ObjectStateManager.TransactionManager.TrackProcessedEntities, "Expected tracking processed entities to be true when adding."); 1177Debug.Assert(this.ObjectStateManager.TransactionManager.ProcessedEntities != null, "Expected non-null collection when flag set."); 1179this.ObjectStateManager.TransactionManager.ProcessedEntities.Add(wrappedEntity); 1183ObjectStateManager.FixupReferencesByForeignKeys(entry); 1198!wrappedEntity.Context.ObjectStateManager.IsDisposed && 1225return this.ObjectStateManager.CreateEntityKey(entitySet, entity); 1693ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1699ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1714EntityEntry cacheEntry = this.ObjectStateManager.FindEntityEntry(entity); 1741ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1747ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1762EntityEntry cacheEntry = this.ObjectStateManager.FindEntityEntry(entity); 1967ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1978ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 1992ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 2002ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 2022EntityEntry entry = ObjectStateManager.FindEntityEntry(key); 2109ObjectStateManager.TransactionManager.BeginDetaching(); 2116ObjectStateManager.TransactionManager.EndDetaching(); 2247EntityEntry entry = ObjectStateManager.FindEntityEntry(entity); 2330ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 2336this.ObjectStateManager.DetectChanges(); 2339if (ObjectStateManager.SomeEntryWithConceptualNullExists()) 2345Int32 entriesAffected = ObjectStateManager.GetObjectStateEntriesCount(EntityState.Added | EntityState.Deleted | EntityState.Modified); 2395entriesAffected = _adapter.Update(ObjectStateManager); 2442ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 2457ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 2458this.ObjectStateManager.DetectChanges(); 2459ObjectStateManager.AssertAllForeignKeyIndexEntriesAreValid(); 2472ObjectStateManager.TryGetEntityEntry(key, out entry); // this will check key argument
System\Data\Objects\ObjectStateManager.cs (10)
906wrappedSource.Context.ObjectStateManager.TransactionManager.IsAttachTracking && 916if (inKeyEntryPromotion && wrappedSource.Context.ObjectStateManager.TransactionManager.IsAttachTracking) 918wrappedSource.Context.ObjectStateManager.TrackPromotedRelationship(relatedEnd, wrappedTarget); 919wrappedSource.Context.ObjectStateManager.TrackPromotedRelationship(targetRelatedEnd, wrappedSource); 972context.ObjectStateManager.TransactionManager.BeginGraphUpdate(); 1015ObjectStateManager manager = context.ObjectStateManager; 1077context.ObjectStateManager.TransactionManager.EndGraphUpdate(); 1117foreach (RelationshipEntry relationshipEntry in context.ObjectStateManager.FindRelationshipsByKey(sourceKey)) 1129foreach (RelationshipEntry relationshipEntry in context.ObjectStateManager.FindRelationshipsByKey(sourceKey)) 1181ObjectStateManager manager = context.ObjectStateManager;
System\Data\Objects\ObjectViewFactory.cs (1)
95object eventDataSource = objectContext.ObjectStateManager;
System\Data\Objects\ObjectViewQueryResultData.cs (1)
201EntityEntry stateEntry = _objectContext.ObjectStateManager.FindEntityEntry(item);
System.Data.Services (6)
System\Data\Services\Providers\ObjectContextServiceProvider.cs (6)
442ObjectStateEntry objectStateEntry = this.ObjectContext.ObjectStateManager.GetObjectStateEntry(resource); 553ObjectStateEntry objectStateEntry = this.ObjectContext.ObjectStateManager.GetObjectStateEntry(objectToBeReplaced.Key); 601foreach (ObjectStateEntry entry in this.ObjectContext.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Deleted | EntityState.Modified | EntityState.Unchanged)) 642ObjectStateEntry objectStateEntry = this.ObjectContext.ObjectStateManager.GetObjectStateEntry(resource); 2407var stateEntry = this.ObjectContext.ObjectStateManager.GetObjectStateEntry(targetResource); 2443!key.Equals(this.ObjectContext.ObjectStateManager.GetObjectStateEntry(propertyValue).EntityKey))
System.Web.Entity (2)
System\Data\WebControls\EntityDataSourceView.cs (1)
407var elementEntitySet = Context.ObjectStateManager.GetObjectStateEntry(element).EntitySet;
System\Data\WebControls\EntityDataSourceWrapper.cs (1)
44if (!this._collection.Context.ObjectStateManager.TryGetObjectStateEntry(trackedEntity, out _stateEntry))