180 references to EntityStates
System.Data.Services.Client (180)
System\Data\Services\Client\AtomMaterializer.cs (4)
1634EntityStates state; 1650(this.mergeOption == MergeOption.PreserveChanges && state == EntityStates.Unchanged) || 1651(this.mergeOption == MergeOption.PreserveChanges && state == EntityStates.Deleted); 1841where MergeOption.OverwriteChanges == this.mergeOption || EntityStates.Added != x.State
System\Data\Services\Client\AtomMaterializerLog.cs (15)
116EntityDescriptor descriptor = new EntityDescriptor(entity.Key, entry.QueryLink, entry.EditLink, entry.ResolvedObject, null, null, null, entry.ETagText, EntityStates.Unchanged); 120descriptor.State = EntityStates.Unchanged; 128EntityStates state; 144if (EntityStates.Added == link.State) 147if ((EntityStates.Deleted == this.context.GetEntityDescriptor(link.Target).State) || 148(EntityStates.Deleted == this.context.GetEntityDescriptor(link.Source).State)) 157else if (EntityStates.Modified == link.State) 170if ((null != target) && (EntityStates.Deleted == this.context.GetEntityDescriptor(target).State) || 171(EntityStates.Deleted == this.context.GetEntityDescriptor(link.Source).State)) 182Debug.Assert(EntityStates.Detached == link.State, "not detached link"); 266EntityStates state; 268if (state == EntityStates.Unchanged) 304LinkDescriptor item = new LinkDescriptor(source.ResolvedObject, propertyName, target, EntityStates.Added); 348LinkDescriptor item = new LinkDescriptor(source.ResolvedObject, propertyName, target, EntityStates.Detached); 373LinkDescriptor 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)); 448if (targetDescriptor.State != EntityStates.Deleted && !this.IsContextTrackingLink(source, sourceProperty, target)) 469if (targetDescriptor.State != EntityStates.Deleted && !this.IsContextTrackingLink(source, sourceProperty, target)) 675if (targetDescriptor.State != EntityStates.Deleted) 912.Where(x => x.ParentEntity == currentEntity && x.State == EntityStates.Added)) 956return descriptor == null || descriptor.State == EntityStates.Deleted;
System\Data\Services\Client\DataServiceContext.cs (141)
930Debug.Assert(box.State != EntityStates.Detached, "We should never have a detached entity in the entityDescriptor dictionary."); 933case EntityStates.Added: 937case EntityStates.Modified: 938case EntityStates.Unchanged: 942case EntityStates.Deleted: 1223this.EnsureRelatable(source, sourceProperty, target, EntityStates.Added); 1231relation.State = EntityStates.Added; 1293bool delay = this.EnsureRelatable(source, sourceProperty, target, EntityStates.Deleted); 1297if (this.bindings.TryGetValue(relation, out existing) && (EntityStates.Added == existing.State)) 1314if (EntityStates.Deleted != existing.State) 1316existing.State = EntityStates.Deleted; 1345this.EnsureRelatable(source, sourceProperty, target, EntityStates.Modified); 1359if (EntityStates.Modified != relation.State) 1361relation.State = EntityStates.Modified; 1388EntityDescriptor resource = new EntityDescriptor(null, null /*selfLink*/, null /*editLink*/, entity, null, null, entitySetName, null, EntityStates.Added); 1422if (sourceResource.State == EntityStates.Deleted) 1447EntityDescriptor targetResource = new EntityDescriptor(null, null, null, target, sourceResource, sourceProperty, null /*entitySetName*/, null, EntityStates.Added); 1460end.State = EntityStates.Added; 1505EntityDescriptor descriptor = new EntityDescriptor(identity, null /* selfLink */, editLink, entity, null /* parent */, null /* parent property */, null /*entitySetName*/, etag, EntityStates.Unchanged); 1528EntityStates state = resource.State; 1529if (EntityStates.Added == state) 1533else if (EntityStates.Deleted != state) 1541resource.State = EntityStates.Deleted; 1581if (EntityStates.Unchanged == resource.State) 1583resource.State = EntityStates.Modified; 1603EntityStates state; 1726end.State = EntityStates.Unchanged; 1734resource.State = EntityStates.Unchanged; 1762end.State = EntityStates.Unchanged; 1783this.EnsureRelatable(source, sourceProperty, target, EntityStates.Unchanged); 1799if ((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))) 1830relation.State = EntityStates.Unchanged; 2109internal object TryGetEntity(String resourceUri, string etag, MergeOption merger, out EntityStates state) 2112state = EntityStates.Detached; 2253private static bool IncludeLinkState(EntityStates x) 2255return ((EntityStates.Modified == x) || (EntityStates.Unchanged == x)); 2363private static string GetEntityHttpMethod(EntityStates state, bool replaceOnUpdate) 2367case EntityStates.Deleted: 2369case EntityStates.Modified: 2379case EntityStates.Added: 2394Debug.Assert(EntityStates.Modified == link.State, "not Modified state"); 2404else if (EntityStates.Deleted == link.State) 2410Debug.Assert(EntityStates.Added == link.State, "not Added state"); 2419if (!((EntityStates.Added == entry.State) || (EntityStates.Modified == entry.State && null != entry.Target))) 2424entry.State = EntityStates.Unchanged; 2435if (EntityStates.Modified != descriptor.State && StreamStates.Modified != descriptor.StreamState) 2448Debug.Assert(descriptor.State == EntityStates.Modified, "descriptor.State == EntityStates.Modified"); 2450descriptor.State = EntityStates.Unchanged; 2456if ((EntityStates.Added == entry.State) || (EntityStates.Modified == entry.State)) 2458link.State = EntityStates.Unchanged; 2460else if (EntityStates.Detached != entry.State) 2623end.Target == resource.Entity && resource.State == EntityStates.Added); 2627resource.State = EntityStates.Detached; 2670Debug.Assert(EntityStates.Added == sourceResource.State, "expected added state"); 2677Debug.Assert(EntityStates.Added == targetResource.State, "expected added state"); 2704if (collection && (EntityStates.Added != binding.State)) 2753if ((EntityStates.Added == binding.State) || (EntityStates.Modified == binding.State && (null != binding.Target))) 2769(binding.State == EntityStates.Added) || 2770(binding.State == EntityStates.Modified && null != binding.Target), 2820private HttpWebRequest CreateRequest(EntityDescriptor box, EntityStates state, bool replaceOnUpdate) 2822Debug.Assert(null != box && ((EntityStates.Added == state) || (EntityStates.Modified == state) || (EntityStates.Deleted == state)), "unexpected entity ResourceState"); 2829if ((null != box.ETag) && ((EntityStates.Deleted == state) || (EntityStates.Modified == state))) 2847Debug.Assert(box.State == EntityStates.Added || box.State == EntityStates.Deleted || box.State == EntityStates.Modified, "the entity must be in one of the 3 possible states"); 2857if (EntityStates.Deleted != box.State) 2862if ((null != box.ETag) && (EntityStates.Deleted == box.State || EntityStates.Modified == box.State)) 2881case EntityStates.Deleted: 2883case EntityStates.Modified: 2884case EntityStates.Added: 2946if (EntityStates.Modified == box.State) 2957if (EntityStates.Added == box.State) 3035Debug.Assert(EntityStates.Added == box.State, "entity not added state"); 3073if (EntityStates.Deleted != entry.State) 3098if (EntityStates.Added != entry.State && StreamStates.Added != entry.StreamState) 3118Debug.Assert(EntityStates.Unchanged == entry.State, "should have moved out of insert"); 3141if (IncludeLinkState(end.SaveResultWasProcessed) || end.SaveResultWasProcessed == EntityStates.Added) 3157if (entry.IsResource && (EntityStates.Added == entry.State)) 3210((0 == target.SaveResultWasProcessed && EntityStates.Added == target.State) || 3211(EntityStates.Added == target.SaveResultWasProcessed)))) 3240if (EntityStates.Added == box.State) 3394(parentOfTarget.State != EntityStates.Deleted || 3395parentOfTarget.State != EntityStates.Detached)) 3404existingLink.State = EntityStates.Detached; 3423(MergeOption.PreserveChanges == linkMerge && EntityStates.Modified == existing.State)) 3472private bool EnsureRelatable(object source, string sourceProperty, object target, EntityStates state) 3476if ((null != target) || ((EntityStates.Modified != state) && (EntityStates.Unchanged != state))) 3494if ((EntityStates.Unchanged == state) && (null == target) && (null != property.CollectionType)) 3499if (((EntityStates.Added == state) || (EntityStates.Deleted == state)) && (null == property.CollectionType)) 3503else if ((EntityStates.Modified == state) && (null != property.CollectionType)) 3519if ((EntityStates.Added == state) || (EntityStates.Unchanged == state)) 3521if ((sourceResource.State == EntityStates.Deleted) || 3522((targetResource != null) && (targetResource.State == EntityStates.Deleted))) 3529if ((EntityStates.Deleted == state) || (EntityStates.Unchanged == state)) 3531if ((sourceResource.State == EntityStates.Added) || 3532((targetResource != null) && (targetResource.State == EntityStates.Added))) 3535if (EntityStates.Deleted == state) 3735if (EntityStates.Added == box.State) 3840bool deletedState = (EntityStates.Deleted == box.State); 4163if (EntityStates.Unchanged == f.State) 4336this.ChangedEntries[this.entryIndex].State == EntityStates.Added || 4337this.ChangedEntries[this.entryIndex].State == EntityStates.Modified, 4553if (this.processingMediaLinkEntryPut && EntityStates.Unchanged == box.State) 4578if (((EntityStates.Unchanged == entry.State) || (EntityStates.Modified == entry.State)) && 4584else if ((EntityStates.Added == entry.State) && (null != (req = this.CheckAndProcessMediaEntryPost(box)))) 4591Debug.Assert(!this.processingMediaLinkEntry || entry.State == EntityStates.Modified, "!this.processingMediaLinkEntry || entry.State == EntityStates.Modified"); 4700entityDescriptor.State = EntityStates.Modified; 4804this.processingMediaLinkEntryPut || entry.State == EntityStates.Modified, 4807!this.processingMediaLinkEntryPut || (entry.State == EntityStates.Unchanged || entry.State == EntityStates.Modified), 4827if ((EntityStates.Added == link.State) || 4828((EntityStates.Modified == link.State) && (null != link.Target))) 4936if (entry.State == EntityStates.Added || 4937(entry.State == EntityStates.Modified && 4970Debug.Assert(entry.State == EntityStates.Modified, "Entity state should be set to Modified once we've sent the POST MR"); 4971entry.State = EntityStates.Added; 5129if (entityDescriptor.State == EntityStates.Added) 5138else if (entityDescriptor.State == EntityStates.Unchanged || entityDescriptor.State == EntityStates.Modified) 5533if (streamState == StreamStates.Added || entry.State == EntityStates.Added) 5576Debug.Assert(descriptor.State == EntityStates.Modified, "The MLE state must be Modified."); 5592Debug.Assert(descriptor.State == EntityStates.Unchanged, "The materializer should always set the entity state to Unchanged."); 5593descriptor.State = EntityStates.Modified; 5611else if (streamState == StreamStates.Modified || entry.State == EntityStates.Modified) 5618else if (entry.State == EntityStates.Deleted)
System\Data\Services\Client\Descriptor.cs (10)
27private EntityStates saveResultProcessed; 33private EntityStates state; 41internal Descriptor(EntityStates state) 49public EntityStates State 80internal EntityStates SaveResultWasProcessed 101(EntityStates.Added == this.state) || 102(EntityStates.Modified == this.state) || 103(EntityStates.Unchanged == this.state) || 104(EntityStates.Deleted == this.state), 107return (EntityStates.Unchanged != this.state);
System\Data\Services\Client\EntityDescriptor.cs (2)
109internal EntityDescriptor(String identity, Uri selfLink, Uri editLink, object entity, EntityDescriptor parentEntity, string parentProperty, string entitySetName, string etag, EntityStates state) 476Debug.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) 54internal LinkDescriptor(object source, string sourceProperty, object target, EntityStates state)