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