180 references to EntityStates
System.Data.Services.Client (180)
System\Data\Services\Client\AtomMaterializer.cs (4)
1634
EntityStates
state;
1650
(this.mergeOption == MergeOption.PreserveChanges && state ==
EntityStates
.Unchanged) ||
1651
(this.mergeOption == MergeOption.PreserveChanges && state ==
EntityStates
.Deleted);
1841
where MergeOption.OverwriteChanges == this.mergeOption ||
EntityStates
.Added != x.State
System\Data\Services\Client\AtomMaterializerLog.cs (15)
116
EntityDescriptor descriptor = new EntityDescriptor(entity.Key, entry.QueryLink, entry.EditLink, entry.ResolvedObject, null, null, null, entry.ETagText,
EntityStates
.Unchanged);
120
descriptor.State =
EntityStates
.Unchanged;
128
EntityStates
state;
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");
266
EntityStates
state;
268
if (state ==
EntityStates
.Unchanged)
304
LinkDescriptor item = new LinkDescriptor(source.ResolvedObject, propertyName, target,
EntityStates
.Added);
348
LinkDescriptor item = new LinkDescriptor(source.ResolvedObject, propertyName, target,
EntityStates
.Detached);
373
LinkDescriptor item = new LinkDescriptor(source.ResolvedObject, propertyName, target,
EntityStates
.Modified);
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 (141)
930
Debug.Assert(box.State !=
EntityStates
.Detached, "We should never have a detached entity in the entityDescriptor dictionary.");
933
case
EntityStates
.Added:
937
case
EntityStates
.Modified:
938
case
EntityStates
.Unchanged:
942
case
EntityStates
.Deleted:
1223
this.EnsureRelatable(source, sourceProperty, target,
EntityStates
.Added);
1231
relation.State =
EntityStates
.Added;
1293
bool delay = this.EnsureRelatable(source, sourceProperty, target,
EntityStates
.Deleted);
1297
if (this.bindings.TryGetValue(relation, out existing) && (
EntityStates
.Added == existing.State))
1314
if (
EntityStates
.Deleted != existing.State)
1316
existing.State =
EntityStates
.Deleted;
1345
this.EnsureRelatable(source, sourceProperty, target,
EntityStates
.Modified);
1359
if (
EntityStates
.Modified != relation.State)
1361
relation.State =
EntityStates
.Modified;
1388
EntityDescriptor resource = new EntityDescriptor(null, null /*selfLink*/, null /*editLink*/, entity, null, null, entitySetName, null,
EntityStates
.Added);
1422
if (sourceResource.State ==
EntityStates
.Deleted)
1447
EntityDescriptor targetResource = new EntityDescriptor(null, null, null, target, sourceResource, sourceProperty, null /*entitySetName*/, null,
EntityStates
.Added);
1460
end.State =
EntityStates
.Added;
1505
EntityDescriptor descriptor = new EntityDescriptor(identity, null /* selfLink */, editLink, entity, null /* parent */, null /* parent property */, null /*entitySetName*/, etag,
EntityStates
.Unchanged);
1528
EntityStates
state = resource.State;
1529
if (
EntityStates
.Added == state)
1533
else if (
EntityStates
.Deleted != state)
1541
resource.State =
EntityStates
.Deleted;
1581
if (
EntityStates
.Unchanged == resource.State)
1583
resource.State =
EntityStates
.Modified;
1603
EntityStates
state;
1726
end.State =
EntityStates
.Unchanged;
1734
resource.State =
EntityStates
.Unchanged;
1762
end.State =
EntityStates
.Unchanged;
1783
this.EnsureRelatable(source, sourceProperty, target,
EntityStates
.Unchanged);
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)))
1830
relation.State =
EntityStates
.Unchanged;
2109
internal object TryGetEntity(String resourceUri, string etag, MergeOption merger, out
EntityStates
state)
2112
state =
EntityStates
.Detached;
2253
private static bool IncludeLinkState(
EntityStates
x)
2255
return ((
EntityStates
.Modified == x) || (
EntityStates
.Unchanged == x));
2363
private static string GetEntityHttpMethod(
EntityStates
state, bool replaceOnUpdate)
2367
case
EntityStates
.Deleted:
2369
case
EntityStates
.Modified:
2379
case
EntityStates
.Added:
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)))
2424
entry.State =
EntityStates
.Unchanged;
2435
if (
EntityStates
.Modified != descriptor.State && StreamStates.Modified != descriptor.StreamState)
2448
Debug.Assert(descriptor.State ==
EntityStates
.Modified, "descriptor.State == EntityStates.Modified");
2450
descriptor.State =
EntityStates
.Unchanged;
2456
if ((
EntityStates
.Added == entry.State) || (
EntityStates
.Modified == entry.State))
2458
link.State =
EntityStates
.Unchanged;
2460
else if (
EntityStates
.Detached != entry.State)
2623
end.Target == resource.Entity && resource.State ==
EntityStates
.Added);
2627
resource.State =
EntityStates
.Detached;
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),
2820
private HttpWebRequest CreateRequest(EntityDescriptor box,
EntityStates
state, bool replaceOnUpdate)
2822
Debug.Assert(null != box && ((
EntityStates
.Added == state) || (
EntityStates
.Modified == state) || (
EntityStates
.Deleted == state)), "unexpected entity ResourceState");
2829
if ((null != box.ETag) && ((
EntityStates
.Deleted == state) || (
EntityStates
.Modified == state)))
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");
2857
if (
EntityStates
.Deleted != box.State)
2862
if ((null != box.ETag) && (
EntityStates
.Deleted == box.State ||
EntityStates
.Modified == box.State))
2881
case
EntityStates
.Deleted:
2883
case
EntityStates
.Modified:
2884
case
EntityStates
.Added:
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");
3141
if (IncludeLinkState(end.SaveResultWasProcessed) || end.SaveResultWasProcessed ==
EntityStates
.Added)
3157
if (entry.IsResource && (
EntityStates
.Added == entry.State))
3210
((0 == target.SaveResultWasProcessed &&
EntityStates
.Added == target.State) ||
3211
(
EntityStates
.Added == target.SaveResultWasProcessed))))
3240
if (
EntityStates
.Added == box.State)
3394
(parentOfTarget.State !=
EntityStates
.Deleted ||
3395
parentOfTarget.State !=
EntityStates
.Detached))
3404
existingLink.State =
EntityStates
.Detached;
3423
(MergeOption.PreserveChanges == linkMerge &&
EntityStates
.Modified == existing.State))
3472
private bool EnsureRelatable(object source, string sourceProperty, object target,
EntityStates
state)
3476
if ((null != target) || ((
EntityStates
.Modified != state) && (
EntityStates
.Unchanged != state)))
3494
if ((
EntityStates
.Unchanged == state) && (null == target) && (null != property.CollectionType))
3499
if (((
EntityStates
.Added == state) || (
EntityStates
.Deleted == state)) && (null == property.CollectionType))
3503
else if ((
EntityStates
.Modified == state) && (null != property.CollectionType))
3519
if ((
EntityStates
.Added == state) || (
EntityStates
.Unchanged == state))
3521
if ((sourceResource.State ==
EntityStates
.Deleted) ||
3522
((targetResource != null) && (targetResource.State ==
EntityStates
.Deleted)))
3529
if ((
EntityStates
.Deleted == state) || (
EntityStates
.Unchanged == state))
3531
if ((sourceResource.State ==
EntityStates
.Added) ||
3532
((targetResource != null) && (targetResource.State ==
EntityStates
.Added)))
3535
if (
EntityStates
.Deleted == state)
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");
4700
entityDescriptor.State =
EntityStates
.Modified;
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");
4971
entry.State =
EntityStates
.Added;
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.");
5593
descriptor.State =
EntityStates
.Modified;
5611
else if (streamState == StreamStates.Modified || entry.State ==
EntityStates
.Modified)
5618
else if (entry.State ==
EntityStates
.Deleted)
System\Data\Services\Client\Descriptor.cs (10)
27
private
EntityStates
saveResultProcessed;
33
private
EntityStates
state;
41
internal Descriptor(
EntityStates
state)
49
public
EntityStates
State
80
internal
EntityStates
SaveResultWasProcessed
101
(
EntityStates
.Added == this.state) ||
102
(
EntityStates
.Modified == this.state) ||
103
(
EntityStates
.Unchanged == this.state) ||
104
(
EntityStates
.Deleted == this.state),
107
return (
EntityStates
.Unchanged != this.state);
System\Data\Services\Client\EntityDescriptor.cs (2)
109
internal EntityDescriptor(String identity, Uri selfLink, Uri editLink, object entity, EntityDescriptor parentEntity, string parentProperty, string entitySetName, string etag,
EntityStates
state)
476
Debug.Assert(this.State ==
EntityStates
.Added, "the entity must be in added state");
System\Data\Services\Client\LinkDescriptor.cs (2)
43
: this(source, sourceProperty, target,
EntityStates
.Unchanged)
54
internal LinkDescriptor(object source, string sourceProperty, object target,
EntityStates
state)