73 references to Detached
System.Data.Entity (72)
System\Data\Common\EntityUtil.cs (2)
846
case EntityState.
Detached
:
860
case EntityState.
Detached
:
System\Data\Common\Internal\Materialization\Shaper.cs (2)
341
if (targetEntry.State == EntityState.
Detached
)
762
Debug.Assert(EntityState.
Detached
!= existingEntry.State, "entry in State=Detached");
System\Data\Objects\DataClasses\EntityObject.cs (3)
52
return EntityState.
Detached
;
89
Debug.Assert(EntityChangeTracker != s_detachedEntityChangeTracker ? EntityChangeTracker.EntityState != EntityState.
Detached
: true,
222
return EntityState != EntityState.
Detached
;
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (2)
403
if (relationshipEntry != null && relationshipEntry.State != EntityState.
Detached
)
445
if (relationshipEntry.State != EntityState.
Detached
)
System\Data\Objects\DataClasses\RelatedEnd.cs (7)
342
entityState = EntityState.
Detached
;
363
Debug.Assert(!(entityState != EntityState.
Detached
&& UsingNoTracking), "Entity with NoTracking option cannot exist in the ObjectStateManager");
370
if (!((entityState == EntityState.
Detached
&& UsingNoTracking) ||
951
Debug.Assert(stateEntry.State != EntityState.
Detached
,
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 (15)
440
_cache.ChangeState(this, EntityState.Deleted, EntityState.
Detached
);
544
if (this.State == EntityState.
Detached
&& state == EntityState.
Detached
)
1183
SetCachedChangingValues(null, null, null, EntityState.
Detached
, null);
1287
Debug.Assert(this.State != EntityState.
Detached
, "Change tracking should not happen on detached entities.");
1562
Debug.Assert(this.State != EntityState.
Detached
, "Change tracking should not happen on detached entities.");
1630
if (changingState == EntityState.
Detached
)
2463
_cache.ChangeState(this, this.State, EntityState.
Detached
);
2495
_cache.ChangeState(this, EntityState.Added, EntityState.
Detached
);
2633
if (State != EntityState.
Detached
)
3103
case EntityState.
Detached
:
3136
case EntityState.
Detached
:
3170
case EntityState.
Detached
:
3225
case EntityState.
Detached
:
3233
case EntityState.
Detached
:
System\Data\Objects\ObjectContext.cs (3)
2032
Debug.Assert(EntityState.
Detached
!= entry.State, "not expecting detached");
2102
if (EntityState.
Detached
!= item.Value.State)
2118
Debug.Assert(EntityState.
Detached
!= item.Value.State, "not expecting detached");
System\Data\Objects\ObjectStateEntry.cs (2)
348
_state = EntityState.
Detached
;
353
if (_state == EntityState.
Detached
)
System\Data\Objects\ObjectStateManager.cs (29)
498
if (!(dFkEntry.State == EntityState.
Detached
|| entry.State == EntityState.
Detached
))
516
HashSet<ObjectStateEntry> validEntries = new HashSet<ObjectStateEntry>(GetObjectStateEntriesInternal(~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());
869
Debug.Assert(relationshipEntry.State == EntityState.
Detached
, "relationshipEntry should be Detached");
1280
if (entryToDetach.State != EntityState.
Detached
)
1371
if (relationshipToRemove.State != EntityState.
Detached
)
1597
Debug.Assert(relationship.State != EntityState.
Detached
, "Cannot remove a detached cache entry.");
1650
ChangeState(keyEntry, keyEntry.State, EntityState.
Detached
);
1771
if ((EntityState.
Detached
& state) != 0)
1784
Debug.Assert((EntityState.
Detached
& state) == 0, "Cannot get state entries for detached entities");
1840
Debug.Assert((EntityState.
Detached
& state) == 0, "Cannot get state entries for detached entities");
2168
if (entityState == EntityState.
Detached
)
2288
if (relationshipEntry == null && relationshipState == EntityState.
Detached
)
2311
Debug.Assert(relationshipState != EntityState.
Detached
|| relationshipEntry.State == EntityState.
Detached
, "state should be detached");
2312
return relationshipState == EntityState.
Detached
? null : relationshipEntry;
2336
(relationshipState != EntityState.Deleted && relationshipState != EntityState.
Detached
))
2342
(relationshipState != EntityState.Added && relationshipState != EntityState.
Detached
))
2379
case EntityState.
Detached
:
2682
if (newState == EntityState.
Detached
)
2707
if (newState == EntityState.
Detached
)
2716
ChangeState(relationshipEntry, relationshipEntry.State, EntityState.
Detached
);
3340
if (entry.State != EntityState.
Detached
&&
3465
if (entry.State != EntityState.
Detached
&&
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)
System\Data\Objects\RelationshipEntry.cs (7)
76
_cache.ChangeState(this, EntityState.Deleted, EntityState.
Detached
);
225
if (this.State == EntityState.
Detached
&& state == EntityState.
Detached
)
602
_cache.ChangeState(this, this.State, EntityState.
Detached
);
629
case EntityState.
Detached
:
652
case EntityState.
Detached
:
688
case EntityState.
Detached
:
System.Data.Services (1)
System\Data\Services\Providers\ObjectContextServiceProvider.cs (1)
612
if (entry.State != EntityState.
Detached
&& !entry.IsRelationship && entry.Entity != null)