Esempio n. 1
0
        internal ICancellableAsyncResult BeginExecute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state)
        {
            TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client);

            operationContext = operationContext ?? new OperationContext();

            CommonUtility.AssertNotNullOrEmpty("tableName", table.Name);

            if (this.operations.Count == 0)
            {
                throw new InvalidOperationException(SR.EmptyBatchOperation);
            }

            if (this.operations.Count > 100)
            {
                throw new InvalidOperationException(SR.BatchExceededMaximumNumberOfOperations);
            }

            return(Executor.BeginExecuteAsync(
                       BatchImpl(this, client, table, modifiedOptions),
                       modifiedOptions.RetryPolicy,
                       operationContext,
                       callback,
                       state));
        }