2 writes to _context
System.Data.Entity (2)
System\Data\Objects\DataClasses\RelatedEnd.cs (2)
2330
this.
_context
= context;
2459
this.
_context
= null;
36 references to _context
System.Data.Entity (36)
System\Data\Objects\DataClasses\RelatedEnd.cs (36)
227
return this.
_context
;
330
if (
_context
== null)
336
EntityEntry stateEntry =
_context
.ObjectStateManager.FindEntityEntry(_wrappedOwner.Entity);
535
ObjectQuery<TEntity> query = new ObjectQuery<TEntity>(_sourceQuery,
_context
, mergeOption);
611
StateManagerTypeMetadata metaType =
_context
.ObjectStateManager.GetOrAddStateManagerTypeMetadata(member.DeclaringType);
730
_context
!= null &&
731
_context
.ContextOptions.LazyLoadingEnabled &&
732
!
_context
.InMaterialization &&
745
_context
.ContextOptions.LazyLoadingEnabled = false;
752
_context
.ContextOptions.LazyLoadingEnabled = true;
1085
if (
_context
!= null && !UsingNoTracking)
1173
else if ((
_context
== null || UsingNoTracking) && (targetRelatedEnd.ObjectContext != null && !targetRelatedEnd.UsingNoTracking))
1377
EntityEntry entry =
_context
.ObjectStateManager.GetEntityEntry(wrappedEntity.Entity);
1421
if (null !=
_context
&& doFixup &&
1448
if (
_context
== null || !
_context
.ObjectStateManager.TransactionManager.IsLocalPublicAPI)
1454
if (null !=
_context
&& (deleteEntity ||
1457
!ReferenceEquals(wrappedEntity.Entity,
_context
.ObjectStateManager.TransactionManager.EntityBeingReparented) &&
1458
!ReferenceEquals(
_context
.ObjectStateManager.EntityInvokingFKSetter, wrappedEntity.Entity))
1575
EntityEntry cacheEntry =
_context
.ObjectStateManager.FindEntityEntry(wrappedEntity.Entity);
1591
_context
.GetTypeUsage(otherRelatedEnd.WrappedOwner.IdentityType);
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,
1904
principalKey =
_context
.ObjectStateManager.CreateEntityKey(principalEntitySet, wrappedRelatedEntity.Entity);
2106
Debug.Assert(
_context
!= null, "Can't add to state manager if _context is null");
2112
_context
.AddSingleObject(es, wrappedEntity, "entity");
2116
_context
.AttachSingleObject(wrappedEntity, es, "entity");
2151
Debug.Assert(this.
_context
!= null && wrappedEntity.Context != null, "should be called only if both entities are attached");
2152
Debug.Assert(this.
_context
== wrappedEntity.Context, "both entities should be attached to the same context");
2319
if (
_context
== context && (_usingNoTracking == (mergeOption == MergeOption.NoTracking)))
2335
FindRelationshipSet(
_context
, entitySet, out relationshipType, out relationshipSet);
2450
if (this.
_context
!= null &&