internal TableCommand <DataServiceResponse, DataServiceResponse> GenerateSaveChangesCommand(SaveChangesOptions options, TableRequestOptions requestOptions)
        {
            TableCommand <DataServiceResponse, DataServiceResponse> cmd = new TableCommand <DataServiceResponse, DataServiceResponse>();

            if (requestOptions.ServerTimeout.HasValue)
            {
                this.Timeout = (int)requestOptions.ServerTimeout.Value.TotalSeconds;
            }

            cmd.ExecuteFunc   = () => this.SaveChanges(options);
            cmd.Begin         = (callback, state) => this.BeginSaveChanges(options, callback, state);
            cmd.End           = this.EndSaveChanges;
            cmd.ParseResponse = this.ParseDataServiceResponse;
            cmd.ApplyRequestOptions(requestOptions);
            cmd.Context = this;

            return(cmd);
        }
        private TableCommand <ResultSegment <TElement>, IEnumerable <TElement> > GenerateExecuteCommand(TableContinuationToken continuationToken, TableRequestOptions requestOptions)
        {
            DataServiceQuery <TElement> localQuery = this.Query;

            // Continuation
            localQuery = TableUtilities.ApplyContinuationToQuery <TElement>(continuationToken, localQuery);

            if (requestOptions.ServerTimeout.HasValue)
            {
                localQuery = localQuery.AddQueryOption("timeout", Convert.ToString(requestOptions.ServerTimeout.Value.TotalSeconds));
            }

            TableCommand <ResultSegment <TElement>, IEnumerable <TElement> > cmd = new TableCommand <ResultSegment <TElement>, IEnumerable <TElement> >();

            cmd.ExecuteFunc   = localQuery.Execute;
            cmd.Begin         = (callback, state) => localQuery.BeginExecute(callback, state);
            cmd.End           = localQuery.EndExecute;
            cmd.ParseResponse = this.ParseTableQueryResponse;
            cmd.ApplyRequestOptions(requestOptions);
            cmd.Context = this.Context;
            return(cmd);
        }
        internal TableCommand<DataServiceResponse, DataServiceResponse> GenerateSaveChangesCommand(SaveChangesOptions options, TableRequestOptions requestOptions)
        {
            TableCommand<DataServiceResponse, DataServiceResponse> cmd = new TableCommand<DataServiceResponse, DataServiceResponse>();

            if (requestOptions.ServerTimeout.HasValue)
            {
                this.Timeout = (int)requestOptions.ServerTimeout.Value.TotalSeconds;
            }

            cmd.ExecuteFunc = () => this.SaveChanges(options);
            cmd.Begin = (callback, state) => this.BeginSaveChanges(options, callback, state);
            cmd.End = this.EndSaveChanges;
            cmd.ParseResponse = this.ParseDataServiceResponse;
            cmd.ApplyRequestOptions(requestOptions);
            cmd.Context = this;

            return cmd;
        }