Implemented interface member:
property
State
System.Data.IEntityStateEntry.State
23 writes to State
System.Data.Entity (23)
System\Data\Objects\EntityEntry.cs (16)
218
State
= EntityState.Modified;
462
State
= EntityState.Unchanged;
479
State
= EntityState.Unchanged;
504
State
= EntityState.Modified;
940
State
= (_modifiedFields == null) ? EntityState.Unchanged : EntityState.Modified;
1168
State
= EntityState.Modified;
1240
State
= EntityState.Modified;
2510
State
= EntityState.Deleted;
2525
State
= EntityState.Deleted;
2889
State
= EntityState.Unchanged;
3043
relationshipEntry.
State
= EntityState.Added;
3119
this.
State
= EntityState.Added;
3152
this.
State
= EntityState.Added;
3189
this.
State
= EntityState.Added;
3201
this.
State
= EntityState.Unchanged;
3215
this.
State
= EntityState.Modified;
System\Data\Objects\RelationshipEntry.cs (7)
81
State
= EntityState.Unchanged;
319
State
= EntityState.Unchanged;
562
State
= EntityState.Deleted;
585
State
= EntityState.Deleted;
643
this.
State
= EntityState.Added;
673
this.
State
= EntityState.Added;
683
this.
State
= EntityState.Unchanged;
237 references to State
System.Data.Entity (233)
System\Data\Common\Internal\Materialization\Shaper.cs (8)
209
if (EntityState.Added == existingEntry.
State
)
341
if (targetEntry.
State
== EntityState.Detached)
372
if (targetEntry.
State
!= EntityState.Deleted)
754
if (EntityState.Added == existingEntry.
State
)
761
Debug.Assert(EntityState.Added != existingEntry.
State
, "entry in State=Added");
762
Debug.Assert(EntityState.Detached != existingEntry.
State
, "entry in State=Detached");
766
if (EntityState.Deleted == existingEntry.
State
)
778
if (EntityState.Unchanged == existingEntry.
State
)
System\Data\Objects\DataClasses\EntityReference.cs (6)
134
if (relationshipEntry.
State
!= EntityState.Deleted &&
310
if (WrappedOwner.ObjectStateEntry.
State
!= EntityState.Added &&
432
(EntityKey == null && targetEntity.ObjectStateEntry.
State
== EntityState.Deleted || // setting to a deleted principle
433
(CachedForeignKey == null && targetEntity.ObjectStateEntry.
State
== EntityState.Added))))) // setting to an added principle
659
bool canSetModifiedProps = entry != null && (entry.
State
== EntityState.Modified || entry.
State
== EntityState.Unchanged);
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (4)
308
relationshipEntry.
State
!= EntityState.Deleted)
322
if (existingEntry.
State
== EntityState.Deleted)
403
if (relationshipEntry != null && relationshipEntry.
State
!= EntityState.Detached)
445
if (relationshipEntry.
State
!= EntityState.Detached)
System\Data\Objects\DataClasses\RelatedEnd.cs (23)
352
entityState = stateEntry.
State
;
676
if (entry != null && entry.
State
== EntityState.Deleted)
740
(_wrappedOwner.ObjectStateEntry.
State
== EntityState.Unchanged ||
741
_wrappedOwner.ObjectStateEntry.
State
== EntityState.Modified ||
742
(_wrappedOwner.ObjectStateEntry.
State
== EntityState.Added && IsForeignKey && IsDependentEndOfReferentialConstraint(false)))))
910
if (stateEntry.
State
!= EntityState.Modified &&
911
stateEntry.
State
!= EntityState.Unchanged)
951
Debug.Assert(stateEntry.
State
!= EntityState.Detached,
956
if (stateEntry.
State
!= EntityState.Unchanged &&
957
stateEntry.
State
!= EntityState.Modified)
1117
if (entry != null && entry.
State
== EntityState.Deleted)
1579
if (null != cacheEntry && cacheEntry.
State
== EntityState.Deleted)
1666
if (cacheEntry.
State
== EntityState.Added)
1681
if (doAttach && cacheEntry.
State
!= EntityState.Added)
1703
if (dependentEntry.
State
== EntityState.Unchanged || dependentEntry.
State
== EntityState.Modified)
1758
if (null != cacheEntry && cacheEntry.
State
!= EntityState.Deleted && !wrappedEntity.RelationshipManager.NodeVisited)
1832
if (wrappedRelatedEntity.ObjectStateEntry != null && wrappedRelatedEntity.ObjectStateEntry.
State
== EntityState.Added)
1870
dependent.
State
!= EntityState.Added &&
1871
dependent.
State
!= EntityState.Deleted &&
1872
dependent.
State
!= EntityState.Detached)
2194
if (entry != null && entry.
State
!= EntityState.Detached)
2207
if (deletedEntry != null && deletedEntry.
State
!= EntityState.Detached)
System\Data\Objects\EntityEntry.cs (91)
191
if (EntityState.Modified == this.
State
&& _modifiedFields != null)
214
Debug.Assert(
State
== EntityState.Unchanged ||
State
== EntityState.Modified, "ValidateAndGetOrdinalForProperty should have thrown.");
216
if (EntityState.Unchanged ==
State
)
219
_cache.ChangeState(this, EntityState.Unchanged,
State
);
253
if (
State
== EntityState.Added ||
State
== EntityState.Deleted)
281
if (
State
== EntityState.Unchanged)
287
Debug.Assert(
State
== EntityState.Modified, "Should have handled all other states above.");
336
if (this.
State
== EntityState.Added)
392
if (this.
State
== EntityState.Deleted)
431
Debug.Assert(!this.IsKeyEntry ||
State
== EntityState.Unchanged, "Key ObjectStateEntries must always be unchanged.");
433
switch (
State
)
502
if (EntityState.Unchanged ==
State
)
505
_cache.ChangeState(this, EntityState.Unchanged,
State
);
507
else if (EntityState.Modified !=
State
)
544
if (this.
State
== EntityState.Detached && state == EntityState.Detached)
941
_cache.ChangeState(this, EntityState.Deleted,
State
);
956
Debug.Assert(entry.
State
== EntityState.Deleted, "Relationship ObjectStateEntry should be in deleted state");
964
Debug.Assert(
State
== EntityState.Modified, "SetModifiedAll called when not modified");
1091
if (this.
State
!= _cache.ChangingState)
1093
throw EntityUtil.ChangedInDifferentStateFromChanging(this.
State
, _cache.ChangingState);
1165
EntityState initialState =
State
;
1166
if (
State
!= EntityState.Added)
1170
if (
State
== EntityState.Modified)
1174
if (initialState != this.
State
)
1176
_cache.ChangeState(this, initialState, this.
State
);
1197
if (
State
== EntityState.Added)
1202
EntityState initialState =
State
;
1280
_cache.SaveOriginalValues = (
State
== EntityState.Unchanged ||
State
== EntityState.Modified) &&
1287
Debug.Assert(this.
State
!= EntityState.Detached, "Change tracking should not happen on detached entities.");
1288
SetCachedChangingValues(entityMemberName, changingObject, changingMemberName, this.
State
, oldValue);
1562
Debug.Assert(this.
State
!= EntityState.Detached, "Change tracking should not happen on detached entities.");
1563
SetCachedChangingValues(null, null, null, this.
State
, null);
1642
Debug.Assert(EntityState.Modified ==
State
||
1643
EntityState.Deleted ==
State
||
1644
EntityState.Unchanged ==
State
,
1677
if (this.
State
!= EntityState.Added)
1824
if (this.
State
!= EntityState.Deleted)
1888
if (this.
State
!= EntityState.Deleted && !detectOnly)
1907
Debug.Assert(this.
State
!= EntityState.Added, "This method should not be called for entries in Added state");
1952
if (this.
State
!= EntityState.Deleted)
2112
(principalEntry.
State
== EntityState.Modified || principalEntry.
State
== EntityState.Unchanged))
2190
if (relatedWrapper.ObjectStateEntry.
State
== EntityState.Deleted)
2195
(
State
& (EntityState.Modified | EntityState.Unchanged)) != 0 &&
2196
(relatedWrapper.ObjectStateEntry.
State
& (EntityState.Modified | EntityState.Unchanged)) != 0)
2420
this.
State
!= EntityState.Added &&
2432
relationshipManager.DetachEntityFromRelationships(this.
State
);
2446
EntityState state =
State
;
2463
_cache.ChangeState(this, this.
State
, EntityState.Detached);
2483
if (doFixup && this.
State
!= EntityState.Deleted)
2490
switch (
State
)
2493
Debug.Assert(EntityState.Added ==
State
, "Expected ObjectStateEntry state is Added; make sure FixupRelationship did not corrupt cache entry state");
2508
Debug.Assert(EntityState.Modified ==
State
, "Expected ObjectStateEntry state is Modified; make sure FixupRelationship did not corrupt cache entry state");
2521
Debug.Assert(
State
== EntityState.Unchanged, "Unexpected state");
2522
Debug.Assert(EntityState.Unchanged ==
State
, "Expected ObjectStateEntry state is Unchanged; make sure FixupRelationship did not corrupt cache entry state");
2588
if (relationshipEntry.
State
!= EntityState.Deleted)
2605
if (relationshipEntry.
State
== EntityState.Deleted)
2633
if (
State
!= EntityState.Detached)
2641
if ((relationshipEntry.
State
!= EntityState.Deleted) &&
2794
if (otherEnd.
State
== EntityState.Unchanged || otherEnd.
State
== EntityState.Modified)
2880
if (
State
== EntityState.Added)
2886
if (
State
!= EntityState.Unchanged)
2888
_cache.ChangeState(this, this.
State
, EntityState.Unchanged);
2985
if (this.
State
== EntityState.Deleted)
2996
if (member.IsPartOfKey &&
State
!= EntityState.Added)
3040
if (relationshipEntry.
State
== EntityState.Unchanged)
3046
else if (relationshipEntry.
State
== EntityState.Deleted)
3075
switch (this.
State
)
3241
Debug.Assert(EntityState.Added != this.
State
, "Cannot change original values of an entity in the Added state");
3243
EntityState oldState = this.
State
;
3247
if (oldState == EntityState.Unchanged && this.
State
== EntityState.Modified)
3346
if (this.
State
!= EntityState.Modified &&
3347
this.
State
!= EntityState.Unchanged)
3349
throw EntityUtil.EntityMustBeUnchangedOrModified(this.
State
);
3373
if (this.
State
!= EntityState.Modified &&
3374
this.
State
!= EntityState.Unchanged &&
3375
this.
State
!= EntityState.Deleted)
3377
throw EntityUtil.EntityMustBeUnchangedOrModifiedOrDeleted(this.
State
);
3532
relatedEnd.ReferenceValue.ObjectStateEntry.
State
!= EntityState.Added);
3546
principalEntry.
State
!= EntityState.Deleted &&
3573
if (setIsLoaded && principalEntry.
State
!= EntityState.Added)
3709
if (principalEntry != null && principalEntry.
State
== EntityState.Added &&
3760
if (dependentEntry.
State
!= EntityState.Added && !dependentPropsChecked)
3780
if (dependentEntry.
State
== EntityState.Added || (dependentEntry.
State
== EntityState.Modified && !fkOverlapsPk))
3907
Debug.Assert(this.
State
== EntityState.Added || this.
State
== EntityState.Modified, "unexpected state");
System\Data\Objects\Internal\SnapshotChangeTrackingStrategy.cs (1)
88
if (entry.
State
!= EntityState.Added)
System\Data\Objects\ObjectContext.cs (15)
579
if (existingEntry.
State
!= exptectedState)
583
EntityUtil.ObjectStateManagerDoesnotAllowToReAddUnchangedOrModifiedOrDeletedEntity(existingEntry.
State
);
961
if (ose.
State
!= EntityState.Modified &&
962
ose.
State
!= EntityState.Unchanged &&
963
ose.
State
!= EntityState.Deleted)
965
throw EntityUtil.EntityMustBeUnchangedOrModifiedOrDeleted(ose.
State
);
2027
if (EntityState.Added == entry.
State
)
2031
Debug.Assert(EntityState.Added != entry.
State
, "not expecting added");
2032
Debug.Assert(EntityState.Detached != entry.
State
, "not expecting detached");
2101
Debug.Assert(EntityState.Added != item.Value.
State
, "should not be possible");
2102
if (EntityState.Detached != item.Value.
State
)
2118
Debug.Assert(EntityState.Detached != item.Value.
State
, "not expecting detached");
2131
Debug.Assert(EntityState.Added != item.Value.
State
, "should not be possible");
2132
if (item.Value.
State
== EntityState.Deleted)
2248
if ((null != entry) && (EntityState.Modified == entry.
State
))
System\Data\Objects\ObjectStateEntry.cs (1)
312
return this.
State
;
System\Data\Objects\ObjectStateEntryDbDataRecord.cs (2)
33
switch (cacheEntry.
State
)
51
switch (cacheEntry.
State
)
System\Data\Objects\ObjectStateEntryDbUpdatableDataRecord.cs (2)
29
switch (cacheEntry.
State
)
44
switch (cacheEntry.
State
)
System\Data\Objects\ObjectStateEntryOriginalDbUpdatableDataRecord.cs (3)
31
switch (cacheEntry.
State
)
91
EntityState oldState = entry.
State
;
118
if (oldState == EntityState.Unchanged && entry.
State
== EntityState.Modified)
System\Data\Objects\ObjectStateManager.cs (64)
296
AddEntityEntryToDictionary(entry, entry.
State
);
399
if (existingEntry.
State
!= EntityState.Added) // (state == DataRowState.Unchanged && state == DataRowState.Modified)
401
throw EntityUtil.ObjectStateManagerDoesnotAllowToReAddUnchangedOrModifiedOrDeletedEntity(existingEntry.
State
);
439
AddEntityEntryToDictionary(newEntry, newEntry.
State
);
498
if (!(dFkEntry.
State
== EntityState.Detached || entry.
State
== EntityState.Detached))
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());
716
if (relationshipEntry.
State
!= EntityState.Deleted)
864
if (relationshipEntry.
State
== EntityState.Deleted)
869
Debug.Assert(relationshipEntry.
State
== EntityState.Detached, "relationshipEntry should be Detached");
1133
relationshipEntry.
State
!= EntityState.Added)
1216
if (relationshipEntry.
State
!= EntityState.Deleted)
1218
Debug.Assert(relationshipEntry.
State
== EntityState.Added || relationshipEntry.
State
== EntityState.Unchanged, "Unexpected relationshipEntry state");
1231
switch (relationshipEntry.
State
)
1280
if (entryToDetach.
State
!= EntityState.Detached)
1303
if (relationshipEntry.
State
== EntityState.Added)
1307
else if (relationshipEntry.
State
== EntityState.Deleted)
1314
if (targetEntry.
State
!= EntityState.Deleted)
1335
if (relationshipEntry.
State
== EntityState.Added)
1364
if (relationshipToRemove.
State
!= EntityState.Deleted)
1371
if (relationshipToRemove.
State
!= EntityState.Detached)
1439
AddEntityEntryToDictionary(newEntry, newEntry.
State
);
1518
Debug.Assert(null == entry || (EntityState.Modified != entry.
State
), "relationship should never be modified");
1524
else if (EntityState.Deleted != entry.
State
)
1541
Debug.Assert(EntityState.Deleted == entry.
State
, "should be deleted state");
1546
Debug.Assert(desiredState == entry.
State
||
1597
Debug.Assert(relationship.
State
!= EntityState.Detached, "Cannot remove a detached cache entry.");
1650
ChangeState(keyEntry, keyEntry.
State
, EntityState.Detached);
1960
Debug.Assert(entry.
State
== EntityState.Added, "Cannot do key fixup for an entry not in the Added state.");
2010
RemoveObjectStateEntryFromDictionary(relationshipEntry, relationshipEntry.
State
);
2029
AddRelationshipEntryToDictionary(relationshipEntry, relationshipEntry.
State
);
2037
Debug.Assert(existingEntry.
State
== EntityState.Unchanged, "entity stub must be in unchanged state");
2069
Debug.Assert(entry.
State
!= EntityState.Added, "Cannot replace key with a temporary key if the entry is in Added state.");
2084
RemoveObjectStateEntryFromDictionary(relationshipEntry, relationshipEntry.
State
);
2088
RemoveObjectStateEntryFromDictionary(entry, entry.
State
);
2100
AddRelationshipEntryToDictionary(relationshipEntry, relationshipEntry.
State
);
2311
Debug.Assert(relationshipState != EntityState.Detached || relationshipEntry.
State
== EntityState.Detached, "state should be detached");
2335
if ((sourceEntry.
State
== EntityState.Deleted || targetEntry.
State
== EntityState.Deleted) &&
2341
if ((sourceEntry.
State
== EntityState.Added || targetEntry.
State
== EntityState.Added) &&
2716
ChangeState(relationshipEntry, relationshipEntry.
State
, EntityState.Detached);
3130
if (entry.
State
== EntityState.Deleted)
3142
if (entry.
State
== EntityState.Unchanged || entry.
State
== EntityState.Modified)
3176
if (pair.Key.IsForeignKey && (entry.
State
== EntityState.Unchanged || entry.
State
== EntityState.Modified))
3258
(relatedEntry.
State
== EntityState.Unchanged ||
3259
relatedEntry.
State
== EntityState.Modified))
3321
if (entry.
State
== EntityState.Added || entry.
State
== EntityState.Modified)
3340
if (entry.
State
!= EntityState.Detached &&
3384
if (relatedEntry.
State
!= EntityState.Deleted)
3465
if (entry.
State
!= EntityState.Detached &&
3466
entry.
State
!= EntityState.Deleted &&
3547
if (entry.
State
== EntityState.Detached || entry.
State
== EntityState.Deleted || entry.IsKeyEntry)
3584
if (entry.
State
== EntityState.Detached || entry.
State
== EntityState.Deleted || entry.IsKeyEntry)
3592
if (entry.
State
== EntityState.Detached || entry.
State
== EntityState.Deleted || entry.IsKeyEntry)
3705
if (entry.
State
!= EntityState.Added)
System\Data\Objects\RelationshipEntry.cs (13)
69
switch (
State
)
179
if (this.
State
== EntityState.Added)
204
if (this.
State
== EntityState.Deleted)
225
if (this.
State
== EntityState.Detached && state == EntityState.Detached)
320
_cache.ChangeState(this, EntityState.Deleted,
State
);
397
if (
State
== EntityState.Deleted && throwException)
500
if (
State
!= EntityState.Deleted) //for deleted ObjectStateEntry its a no-op
548
if (this.
State
== EntityState.Added)
561
_cache.ChangeState(this, this.
State
, EntityState.Deleted);
569
switch (
State
)
602
_cache.ChangeState(this, this.
State
, EntityState.Detached);
609
Debug.Assert(this.
State
!= EntityState.Modified, "Invalid initial state for relationsihp");
611
EntityState initialState = this.
State
;
System.Data.Services (4)
System\Data\Services\Providers\ObjectContextServiceProvider.cs (4)
443
if (objectStateEntry.
State
== EntityState.Added)
555
if (objectStateEntry.
State
== EntityState.Added)
612
if (entry.
State
!= EntityState.Detached && !entry.IsRelationship && entry.Entity != null)
2420
if (stateEntry.
State
!= EntityState.Added && !relatedEnd.IsLoaded)