コード例 #1
0
        private void VerifyChangeOnServer(ChangeData change, IAsyncContinuation continuation)
        {
            //// For now use different data service context to re-query and verify entities and links.
            //// In the future consider using an 'Oracle' component to re-query the changes if/when it comes online.
            using (IWrapperScope scope = new NullWrapperScope())
            {
                WrappedDataServiceContext otherContext = this.DataServiceContextCreator.CreateContext(scope, this.currentContextData.ContextType, this.currentContextData.BaseUri);
                otherContext.ResolveName = this.currentContextData.ResolveName;
                otherContext.ResolveType = this.currentContextData.ResolveType;
                otherContext.IgnoreResourceNotFoundException = true;

                var uri = change.GetUriForRequery();
                otherContext.Execute <WrappedObject>(
                    continuation,
                    this.Asynchronous,
                    change.ClrTypeForRequery,
                    uri,
                    results =>
                {
                    var result = results.ToList();
                    VerifyChangeOnServer(change, otherContext, result);
                    continuation.Continue();
                });
            }
        }
コード例 #2
0
        private void VerifyChangeOnServer(ChangeData change, IAsyncContinuation continuation)
        {
            //// For now use different data service context to re-query and verify entities and links.
            //// In the future consider using an 'Oracle' component to re-query the changes if/when it comes online.
            using (IWrapperScope scope = new NullWrapperScope())
            {
                WrappedDataServiceContext otherContext = this.DataServiceContextCreator.CreateContext(scope, this.currentContextData.ContextType, this.currentContextData.BaseUri);
                otherContext.ResolveName = this.currentContextData.ResolveName;
                otherContext.ResolveType = this.currentContextData.ResolveType;
                otherContext.IgnoreResourceNotFoundException = true;

                var uri = change.GetUriForRequery();
                otherContext.Execute<WrappedObject>(
                    continuation, 
                    this.Asynchronous,
                    change.ClrTypeForRequery,
                    uri,
                    results =>
                    {
                        var result = results.ToList();
                        VerifyChangeOnServer(change, otherContext, result);
                        continuation.Continue();
                    });
            }
        }