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