public void ProcessedEntity(OfflineEntity entity) { string atomId = entity.ServiceMetadata.Id; OfflineEntityKey key = (OfflineEntityKey)entity.GetIdentity(); key.TypeName = entity.GetType().FullName; if (entity.IsTombstone) { if (String.IsNullOrEmpty(atomId)) { pkeySet.Add(key); } else { atomIdSet.Add(atomId); } } else { pkeySet.Add(key); if (!String.IsNullOrEmpty(atomId)) { atomIdSet.Add(atomId); } } }
public bool ContainsEntity(OfflineEntity entity) { // If the entity is a tombstone, use the atom id if (entity.IsTombstone) { if (String.IsNullOrEmpty(entity.ServiceMetadata.Id)) { // if it's a tombstone and the id is null, it means it is a delete of // a local insert that can be skipped, so we report it as already written return(true); } return(atomIdSet.Contains(entity.ServiceMetadata.Id)); } if (!String.IsNullOrEmpty(entity.ServiceMetadata.Id)) { return(atomIdSet.Contains(entity.ServiceMetadata.Id)); } OfflineEntityKey key = (OfflineEntityKey)entity.GetIdentity(); key.TypeName = entity.GetType().FullName; return(pkeySet.Contains(key)); }