126 references to Added
System.Data.Entity (122)
System\Data\Common\EntityUtil.cs (2)
842
case EntityState.
Added
:
857
case EntityState.
Added
:
System\Data\Common\Internal\Materialization\Shaper.cs (3)
209
if (EntityState.
Added
== existingEntry.State)
754
if (EntityState.
Added
== existingEntry.State)
761
Debug.Assert(EntityState.
Added
!= existingEntry.State, "entry in State=Added");
System\Data\EntityClient\EntityAdapter.cs (1)
137
EntityState.
Added
| EntityState.Deleted | EntityState.Modified))
System\Data\Mapping\Update\Internal\ExtractedStateEntry.cs (1)
53
case EntityState.
Added
:
System\Data\Mapping\Update\Internal\ExtractorMetadata.cs (1)
222
Debug.Assert(entityEntry.State == EntityState.
Added
,
System\Data\Mapping\Update\Internal\FunctionMappingTranslator.cs (3)
173
case EntityState.
Added
:
204
case EntityState.
Added
:
309
bool isInsert = EntityState.
Added
== stateEntry.State;
System\Data\Mapping\Update\Internal\FunctionUpdateCommand.cs (1)
349
case EntityState.
Added
:
System\Data\Mapping\Update\Internal\RelationshipConstraintValidator.cs (5)
72
if (EntityState.
Added
== stateEntry.State || EntityState.Deleted == stateEntry.State)
80
EntityType entityType = EntityState.
Added
== stateEntry.State ?
230
violationType = EntityState.
Added
;
263
(isAdd && EntityState.
Added
!= entityEntry.State) ||
445
if (current.StateEntry.State == EntityState.
Added
)
System\Data\Mapping\Update\Internal\UpdateCommand.cs (2)
112
if (stateEntry.State == EntityState.
Added
)
141
bool isAdded = stateEntry.State == EntityState.
Added
;
System\Data\Mapping\Update\Internal\UpdateTranslator.cs (7)
173
DbDataRecord record = stateEntry.State == EntityState.
Added
?
208
if (stateEntry.State == EntityState.
Added
|| stateEntry.State == EntityState.Modified)
325
(stateEntry.State == EntityState.
Added
|| stateEntry.State == EntityState.Modified))
839
foreach (IEntityStateEntry addedEntry in m_stateManager.GetEntityStateEntries(EntityState.
Added
))
849
foreach (IEntityStateEntry modifiedEntry in m_stateManager.GetEntityStateEntries(EntityState.Modified | EntityState.
Added
| EntityState.Deleted))
854
foreach (IEntityStateEntry modifiedEntry in m_stateManager.GetEntityStateEntries(EntityState.Modified | EntityState.
Added
| EntityState.Deleted))
937
if (0 != ((EntityState.
Added
| EntityState.Modified | EntityState.Unchanged) & stateEntry.State))
System\Data\Objects\DataClasses\EntityReference.cs (3)
273
EntityState relationshipState = EntityState.
Added
;
310
if (WrappedOwner.ObjectStateEntry.State != EntityState.
Added
&&
433
(CachedForeignKey == null && targetEntity.ObjectStateEntry.State == EntityState.
Added
))))) // setting to an added principle
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (1)
366
manager.AddNewRelation(wrapper, doAttach ? EntityState.Unchanged : EntityState.
Added
);
System\Data\Objects\DataClasses\RelatedEnd.cs (9)
356
if (entityState == EntityState.
Added
&&
374
entityState == EntityState.
Added
))
742
(_wrappedOwner.ObjectStateEntry.State == EntityState.
Added
&& IsForeignKey && IsDependentEndOfReferentialConstraint(false)))))
1666
if (cacheEntry.State == EntityState.
Added
)
1681
if (doAttach && cacheEntry.State != EntityState.
Added
)
1832
if (wrappedRelatedEntity.ObjectStateEntry != null && wrappedRelatedEntity.ObjectStateEntry.State == EntityState.
Added
)
1870
dependent.State != EntityState.
Added
&&
1997
ownerEntityState == EntityState.
Added
||
2165
(addRelationshipAsUnchanged || doAttach) ? EntityState.Unchanged : EntityState.
Added
);
System\Data\Objects\EntityEntry.cs (31)
253
if (State == EntityState.
Added
|| State == EntityState.Deleted)
336
if (this.State == EntityState.
Added
)
443
case EntityState.
Added
:
1166
if (State != EntityState.
Added
)
1197
if (State == EntityState.
Added
)
1677
if (this.State != EntityState.
Added
)
1907
Debug.Assert(this.State != EntityState.
Added
, "This method should not be called for entries in Added state");
2420
this.State != EntityState.
Added
&&
2467
if (state != EntityState.
Added
)
2492
case EntityState.
Added
:
2493
Debug.Assert(EntityState.
Added
== State, "Expected ObjectStateEntry state is Added; make sure FixupRelationship did not corrupt cache entry state");
2495
_cache.ChangeState(this, EntityState.
Added
, EntityState.Detached);
2880
if (State == EntityState.
Added
)
2996
if (member.IsPartOfKey && State != EntityState.
Added
)
3042
this.ObjectStateManager.ChangeState(relationshipEntry, EntityState.Unchanged, EntityState.
Added
);
3043
relationshipEntry.State = EntityState.
Added
;
3077
case EntityState.
Added
:
3080
case EntityState.
Added
:
3114
case EntityState.
Added
:
3119
this.State = EntityState.
Added
;
3147
case EntityState.
Added
:
3152
this.State = EntityState.
Added
;
3181
case EntityState.
Added
:
3189
this.State = EntityState.
Added
;
3241
Debug.Assert(EntityState.
Added
!= this.State, "Cannot change original values of an entity in the Added state");
3532
relatedEnd.ReferenceValue.ObjectStateEntry.State != EntityState.
Added
);
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 (7)
504
foreach (ObjectStateEntry entry in ObjectStateManager.GetObjectStateEntries(EntityState.
Added
| EntityState.Modified))
577
EntityState exptectedState = doAttach ? EntityState.Unchanged : EntityState.
Added
;
2027
if (EntityState.
Added
== entry.State)
2031
Debug.Assert(EntityState.
Added
!= entry.State, "not expecting added");
2101
Debug.Assert(EntityState.
Added
!= item.Value.State, "should not be possible");
2131
Debug.Assert(EntityState.
Added
!= item.Value.State, "should not be possible");
2345
Int32 entriesAffected = ObjectStateManager.GetObjectStateEntriesCount(EntityState.
Added
| EntityState.Deleted | EntityState.Modified);
System\Data\Objects\ObjectStateEntryDbUpdatableDataRecord.cs (2)
33
case EntityState.
Added
:
48
case EntityState.
Added
:
System\Data\Objects\ObjectStateManager.cs (28)
399
if (existingEntry.State != EntityState.
Added
) // (state == DataRowState.Unchanged && state == DataRowState.Modified)
429
EntityEntry newEntry = new EntityEntry(wrappedObject, entityKey, entitySet, this, typeMetadata, isAdded ? EntityState.
Added
: EntityState.Unchanged);
1133
relationshipEntry.State != EntityState.
Added
)
1218
Debug.Assert(relationshipEntry.State == EntityState.
Added
|| relationshipEntry.State == EntityState.Unchanged, "Unexpected relationshipEntry state");
1233
case EntityState.
Added
:
1303
if (relationshipEntry.State == EntityState.
Added
)
1335
if (relationshipEntry.State == EntityState.
Added
)
1512
Debug.Assert(EntityState.
Added
== desiredState || // result entry should be added or left alone
1547
EntityState.
Added
== desiredState,
1794
if ((EntityState.
Added
& state) != 0)
1846
if (((EntityState.
Added
& state) != 0) && (null != _addedRelationshipStore))
1867
if (((EntityState.
Added
& state) != 0) && (null != _addedEntityStore))
1960
Debug.Assert(entry.State == EntityState.
Added
, "Cannot do key fixup for an entry not in the Added state.");
2015
RemoveObjectStateEntryFromDictionary(entry, EntityState.
Added
);
2069
Debug.Assert(entry.State != EntityState.
Added
, "Cannot replace key with a temporary key if the entry is in Added state.");
2103
AddEntityEntryToDictionary(entry, EntityState.
Added
);
2341
if ((sourceEntry.State == EntityState.
Added
|| targetEntry.State == EntityState.
Added
) &&
2342
(relationshipState != EntityState.
Added
&& relationshipState != EntityState.Detached))
2356
case EntityState.
Added
:
2769
case EntityState.
Added
:
2811
case EntityState.
Added
:
2877
case EntityState.
Added
:
2899
case EntityState.
Added
:
2921
case EntityState.
Added
:
2947
case EntityState.
Added
:
3321
if (entry.State == EntityState.
Added
|| entry.State == EntityState.Modified)
3705
if (entry.State != EntityState.
Added
)
System\Data\Objects\RelationshipEntry.cs (14)
39
Debug.Assert(EntityState.
Added
== state ||
79
case EntityState.
Added
:
80
_cache.ChangeState(this, EntityState.
Added
, EntityState.Unchanged);
179
if (this.State == EntityState.
Added
)
548
if (this.State == EntityState.
Added
)
571
case EntityState.
Added
:
615
case EntityState.
Added
:
618
case EntityState.
Added
:
641
case EntityState.
Added
:
642
this.ObjectStateManager.ChangeState(this, EntityState.Unchanged, EntityState.
Added
);
643
this.State = EntityState.
Added
;
665
case EntityState.
Added
:
672
this.ObjectStateManager.ChangeState(this, EntityState.Deleted, EntityState.
Added
);
673
this.State = EntityState.
Added
;
System.Data.Services (4)
System\Data\Services\Providers\ObjectContextServiceProvider.cs (4)
443
if (objectStateEntry.State == EntityState.
Added
)
555
if (objectStateEntry.State == EntityState.
Added
)
601
foreach (ObjectStateEntry entry in this.ObjectContext.ObjectStateManager.GetObjectStateEntries(EntityState.
Added
| EntityState.Deleted | EntityState.Modified | EntityState.Unchanged))
2420
if (stateEntry.State != EntityState.
Added
&& !relatedEnd.IsLoaded)