19 writes to State
System.Data.Services.Client (19)
System\Data\Services\Client\AtomMaterializerLog.cs (1)
120
descriptor.
State
= EntityStates.Unchanged;
System\Data\Services\Client\DataServiceContext.cs (18)
1231
relation.
State
= EntityStates.Added;
1316
existing.
State
= EntityStates.Deleted;
1361
relation.
State
= EntityStates.Modified;
1460
end.
State
= EntityStates.Added;
1541
resource.
State
= EntityStates.Deleted;
1583
resource.
State
= EntityStates.Modified;
1726
end.
State
= EntityStates.Unchanged;
1734
resource.
State
= EntityStates.Unchanged;
1762
end.
State
= EntityStates.Unchanged;
1830
relation.
State
= EntityStates.Unchanged;
2424
entry.
State
= EntityStates.Unchanged;
2450
descriptor.
State
= EntityStates.Unchanged;
2458
link.
State
= EntityStates.Unchanged;
2627
resource.
State
= EntityStates.Detached;
3404
existingLink.
State
= EntityStates.Detached;
4700
entityDescriptor.
State
= EntityStates.Modified;
4971
entry.
State
= EntityStates.Added;
5593
descriptor.
State
= EntityStates.Modified;
102 references to State
System.Data.Services.Client (102)
System\Data\Services\Client\AtomMaterializer.cs (1)
1841
where MergeOption.OverwriteChanges == this.mergeOption || EntityStates.Added != x.
State
System\Data\Services\Client\AtomMaterializerLog.cs (7)
144
if (EntityStates.Added == link.
State
)
147
if ((EntityStates.Deleted == this.context.GetEntityDescriptor(link.Target).
State
) ||
148
(EntityStates.Deleted == this.context.GetEntityDescriptor(link.Source).
State
))
157
else if (EntityStates.Modified == link.
State
)
170
if ((null != target) && (EntityStates.Deleted == this.context.GetEntityDescriptor(target).
State
) ||
171
(EntityStates.Deleted == this.context.GetEntityDescriptor(link.Source).
State
))
182
Debug.Assert(EntityStates.Detached == link.
State
, "not detached link");
System\Data\Services\Client\Binding\BindingObserver.cs (6)
401
(source != null && !this.IsContextTrackingLink(source, sourceProperty, target) && targetDescriptor.
State
!= EntityStates.Deleted));
448
if (targetDescriptor.
State
!= EntityStates.Deleted && !this.IsContextTrackingLink(source, sourceProperty, target))
469
if (targetDescriptor.
State
!= EntityStates.Deleted && !this.IsContextTrackingLink(source, sourceProperty, target))
675
if (targetDescriptor.
State
!= EntityStates.Deleted)
912
.Where(x => x.ParentEntity == currentEntity && x.
State
== EntityStates.Added))
956
return descriptor == null || descriptor.
State
== EntityStates.Deleted;
System\Data\Services\Client\DataServiceContext.cs (87)
930
Debug.Assert(box.
State
!= EntityStates.Detached, "We should never have a detached entity in the entityDescriptor dictionary.");
931
switch (box.
State
)
1297
if (this.bindings.TryGetValue(relation, out existing) && (EntityStates.Added == existing.
State
))
1314
if (EntityStates.Deleted != existing.
State
)
1355
0 == relation.
State
||
1356
IncludeLinkState(relation.
State
),
1359
if (EntityStates.Modified != relation.
State
)
1422
if (sourceResource.
State
== EntityStates.Deleted)
1528
EntityStates state = resource.
State
;
1581
if (EntityStates.Unchanged == resource.
State
)
1799
if ((EntityStates.Added == existing.
State
) ||
1800
(EntityStates.Unchanged == existing.
State
) ||
1801
(EntityStates.Modified == existing.
State
&& null != existing.Target))
1821
(MergeOption.PreserveChanges == linkMerge && EntityStates.Modified == existing.
State
)))
2118
state = resource.
State
;
2394
Debug.Assert(EntityStates.Modified == link.
State
, "not Modified state");
2404
else if (EntityStates.Deleted == link.
State
)
2410
Debug.Assert(EntityStates.Added == link.
State
, "not Added state");
2419
if (!((EntityStates.Added == entry.
State
) || (EntityStates.Modified == entry.
State
&& null != entry.Target)))
2435
if (EntityStates.Modified != descriptor.
State
&& StreamStates.Modified != descriptor.StreamState)
2448
Debug.Assert(descriptor.
State
== EntityStates.Modified, "descriptor.State == EntityStates.Modified");
2456
if ((EntityStates.Added == entry.
State
) || (EntityStates.Modified == entry.
State
))
2460
else if (EntityStates.Detached != entry.
State
)
2623
end.Target == resource.Entity && resource.
State
== EntityStates.Added);
2670
Debug.Assert(EntityStates.Added == sourceResource.
State
, "expected added state");
2677
Debug.Assert(EntityStates.Added == targetResource.
State
, "expected added state");
2704
if (collection && (EntityStates.Added != binding.
State
))
2753
if ((EntityStates.Added == binding.
State
) || (EntityStates.Modified == binding.
State
&& (null != binding.Target)))
2769
(binding.
State
== EntityStates.Added) ||
2770
(binding.
State
== EntityStates.Modified && null != binding.Target),
2847
Debug.Assert(box.
State
== EntityStates.Added || box.
State
== EntityStates.Deleted || box.
State
== EntityStates.Modified, "the entity must be in one of the 3 possible states");
2855
WriteOperationRequestHeaders(text, GetEntityHttpMethod(box.
State
, replaceOnUpdate), requestUri.AbsoluteUri, requestVersion);
2857
if (EntityStates.Deleted != box.
State
)
2862
if ((null != box.ETag) && (EntityStates.Deleted == box.
State
|| EntityStates.Modified == box.
State
))
2879
switch (box.
State
)
2946
if (EntityStates.Modified == box.
State
)
2957
if (EntityStates.Added == box.
State
)
3035
Debug.Assert(EntityStates.Added == box.
State
, "entity not added state");
3073
if (EntityStates.Deleted != entry.
State
)
3098
if (EntityStates.Added != entry.
State
&& StreamStates.Added != entry.StreamState)
3118
Debug.Assert(EntityStates.Unchanged == entry.
State
, "should have moved out of insert");
3154
entry.SaveResultWasProcessed = entry.
State
;
3157
if (entry.IsResource && (EntityStates.Added == entry.
State
))
3165
end.SaveResultWasProcessed = end.
State
;
3208
if (IncludeLinkState(target.SaveResultWasProcessed) || ((0 == target.SaveResultWasProcessed) && IncludeLinkState(target.
State
)) ||
3210
((0 == target.SaveResultWasProcessed && EntityStates.Added == target.
State
) ||
3240
if (EntityStates.Added == box.
State
)
3394
(parentOfTarget.
State
!= EntityStates.Deleted ||
3395
parentOfTarget.
State
!= EntityStates.Detached))
3423
(MergeOption.PreserveChanges == linkMerge && EntityStates.Modified == existing.
State
))
3521
if ((sourceResource.
State
== EntityStates.Deleted) ||
3522
((targetResource != null) && (targetResource.
State
== EntityStates.Deleted)))
3531
if ((sourceResource.
State
== EntityStates.Added) ||
3532
((targetResource != null) && (targetResource.
State
== EntityStates.Added)))
3735
if (EntityStates.Added == box.
State
)
3840
bool deletedState = (EntityStates.Deleted == box.
State
);
4163
if (EntityStates.Unchanged == f.
State
)
4336
this.ChangedEntries[this.entryIndex].
State
== EntityStates.Added ||
4337
this.ChangedEntries[this.entryIndex].
State
== EntityStates.Modified,
4553
if (this.processingMediaLinkEntryPut && EntityStates.Unchanged == box.
State
)
4578
if (((EntityStates.Unchanged == entry.
State
) || (EntityStates.Modified == entry.
State
)) &&
4584
else if ((EntityStates.Added == entry.
State
) && (null != (req = this.CheckAndProcessMediaEntryPost(box))))
4591
Debug.Assert(!this.processingMediaLinkEntry || entry.
State
== EntityStates.Modified, "!this.processingMediaLinkEntry || entry.State == EntityStates.Modified");
4592
req = this.Context.CreateRequest(box, entry.
State
, replaceOnUpdate);
4804
this.processingMediaLinkEntryPut || entry.
State
== EntityStates.Modified,
4807
!this.processingMediaLinkEntryPut || (entry.
State
== EntityStates.Unchanged || entry.
State
== EntityStates.Modified),
4827
if ((EntityStates.Added == link.
State
) ||
4828
((EntityStates.Modified == link.
State
) && (null != link.Target)))
4936
if (entry.
State
== EntityStates.Added ||
4937
(entry.
State
== EntityStates.Modified &&
4970
Debug.Assert(entry.
State
== EntityStates.Modified, "Entity state should be set to Modified once we've sent the POST MR");
5129
if (entityDescriptor.
State
== EntityStates.Added)
5138
else if (entityDescriptor.
State
== EntityStates.Unchanged || entityDescriptor.
State
== EntityStates.Modified)
5533
if (streamState == StreamStates.Added || entry.
State
== EntityStates.Added)
5576
Debug.Assert(descriptor.
State
== EntityStates.Modified, "The MLE state must be Modified.");
5592
Debug.Assert(descriptor.
State
== EntityStates.Unchanged, "The materializer should always set the entity state to Unchanged.");
5611
else if (streamState == StreamStates.Modified || entry.
State
== EntityStates.Modified)
5618
else if (entry.
State
== EntityStates.Deleted)
System\Data\Services\Client\EntityDescriptor.cs (1)
476
Debug.Assert(this.
State
== EntityStates.Added, "the entity must be in added state");