當前位置: 首頁>>代碼示例>>C#>>正文


C# Storage.OperationContext類代碼示例

本文整理匯總了C#中Microsoft.WindowsAzure.Storage.OperationContext的典型用法代碼示例。如果您正苦於以下問題:C# OperationContext類的具體用法?C# OperationContext怎麽用?C# OperationContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OperationContext類屬於Microsoft.WindowsAzure.Storage命名空間,在下文中一共展示了OperationContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DeleteMessage

 public Task DeleteMessage(CloudQueueMessage message, QueueRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = null)
 {
     return AsyncTaskUtil.RunAsyncCancellable(
         _inner.BeginDeleteMessage(message, options, operationContext, null, null),
         _inner.EndDeleteMessage,
         cancellationToken);
 }
開發者ID:Porges,項目名稱:azure-storage-async,代碼行數:7,代碼來源:AsyncCloudQueue.cs

示例2: Create

 public Task Create(QueueRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = null)
 {
     return AsyncTaskUtil.RunAsyncCancellable(
         _inner.BeginCreate(options, operationContext, null, null),
         _inner.EndCreate,
         cancellationToken);
 }
開發者ID:Porges,項目名稱:azure-storage-async,代碼行數:7,代碼來源:AsyncCloudQueue.cs

示例3: DeleteIfExists

 public Task<bool> DeleteIfExists(QueueRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = null)
 {
     return AsyncTaskUtil.RunAsyncCancellable<bool>(
         _inner.BeginDeleteIfExists(options, operationContext, null, null),
         _inner.EndDeleteIfExists,
         cancellationToken);
 }
開發者ID:Porges,項目名稱:azure-storage-async,代碼行數:7,代碼來源:AsyncCloudQueue.cs

示例4:

 IDictionary<string, EntityProperty> ITableEntity.WriteEntity(OperationContext operationContext)
 {
     return new Dictionary<string, EntityProperty>
     {
         { "SerializedError", EntityProperty.GeneratePropertyForString(this.SerializedError) }
     };
 }
開發者ID:rajwilkhu,項目名稱:NuGetGallery,代碼行數:7,代碼來源:TableErrorLog.cs

示例5: AddMessage

 public Task AddMessage(CloudQueueMessage message, TimeSpan? timeToLive = null, TimeSpan? initialVisibilityDelay = null, QueueRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = null)
 {
     return AsyncTaskUtil.RunAsyncCancellable(
         _inner.BeginAddMessage(message, timeToLive, initialVisibilityDelay, options, operationContext, null, null),
         _inner.EndAddMessage,
         cancellationToken);
 }
開發者ID:Porges,項目名稱:azure-storage-async,代碼行數:7,代碼來源:AsyncCloudQueue.cs

示例6: TableGenericQueryEnumerateTwice

        public void TableGenericQueryEnumerateTwice()
        {
            TableQuery<BaseEntity> query = new TableQuery<BaseEntity>();

            OperationContext opContext = new OperationContext();
            IEnumerable<BaseEntity> enumerable = currentTable.ExecuteQuery(query);

            List<BaseEntity> firstIteration = new List<BaseEntity>();
            List<BaseEntity> secondIteration = new List<BaseEntity>();

            foreach (BaseEntity ent in enumerable)
            {
                Assert.IsTrue(ent.PartitionKey.StartsWith("tables_batch"));
                ent.Validate();
                firstIteration.Add(ent);
            }

            foreach (BaseEntity ent in enumerable)
            {
                Assert.IsTrue(ent.PartitionKey.StartsWith("tables_batch"));
                ent.Validate();
                secondIteration.Add(ent);
            }

            Assert.AreEqual(firstIteration.Count, secondIteration.Count);

            for (int m = 0; m < firstIteration.Count; m++)
            {
                Assert.AreEqual(firstIteration[m].PartitionKey, secondIteration[m].PartitionKey);
                Assert.AreEqual(firstIteration[m].RowKey, secondIteration[m].RowKey);
                Assert.AreEqual(firstIteration[m].Timestamp, secondIteration[m].Timestamp);
                Assert.AreEqual(firstIteration[m].ETag, secondIteration[m].ETag);
                firstIteration[m].Validate();
            }
        }
開發者ID:farukc,項目名稱:rtable,代碼行數:35,代碼來源:RTableQueryGenericTests.cs

示例7: ListBlobsSegmented

 private Task<BlobResultSegment> ListBlobsSegmented(string prefix, bool useFlatBlobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken continuationToken, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken = default(CancellationToken))
 {
     return AsyncTaskUtil.RunAsyncCancellable<BlobResultSegment>(
         _inner.BeginListBlobsSegmented(prefix, useFlatBlobListing, blobListingDetails, maxResults, continuationToken, options, operationContext, null, null),
         _inner.EndListBlobsSegmented,
         cancellationToken);
 }
開發者ID:Porges,項目名稱:azure-storage-async,代碼行數:7,代碼來源:AsyncCloudBlobClient.cs

示例8: ListContainersSegmented

 private Task<ContainerResultSegment> ListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, int? maxResults, BlobContinuationToken continuationToken, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken = default(CancellationToken))
 {
     return AsyncTaskUtil.RunAsyncCancellable<ContainerResultSegment>(
         _inner.BeginListContainersSegmented(prefix, detailsIncluded, maxResults, continuationToken, options, operationContext, null, null),
         _inner.EndListContainersSegmented,
         cancellationToken);
 }
開發者ID:Porges,項目名稱:azure-storage-async,代碼行數:7,代碼來源:AsyncCloudBlobClient.cs

示例9: Index

        // GET: /Subscribe/

        public async Task<ActionResult> Index(string id, string listName)
        {
            // We get to this method when they click on the Confirm link in the
            // email that's sent to them after the subscribe service method is called.
            TableRequestOptions reqOptions = new TableRequestOptions()
            {
                MaximumExecutionTime = TimeSpan.FromSeconds(1.5),
                RetryPolicy = new LinearRetry(TimeSpan.FromSeconds(3), 3)
            };
            string filter = TableQuery.CombineFilters(
                TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, listName),
                TableOperators.And,
                TableQuery.GenerateFilterCondition("SubscriberGUID", QueryComparisons.Equal, id));
            var query = new TableQuery<Subscriber>().Where(filter);
            TableContinuationToken token = null;
            OperationContext ctx = new OperationContext() { ClientRequestID = "" };
            TableQuerySegment<Subscriber> currentSegment = null;
            currentSegment = await mailingListTable.ExecuteQuerySegmentedAsync(query, token, reqOptions, ctx);
            var subscriber = currentSegment.Results.ToList().Single();

            //subscriberTableRow.Status = "Verified";
            subscriber.Verified = true;
            var replaceOperation = TableOperation.Merge(subscriber);
            mailingListTable.Execute(replaceOperation);

            var newSubscriber = new SubscribeVM();
            newSubscriber.EmailAddress = subscriber.EmailAddress;
            var mailingList = await FindRowAsync(subscriber.ListName, "mailinglist");
            newSubscriber.ListDescription = mailingList.Description;
            return View(newSubscriber);
        }
開發者ID:Jinwenxin,項目名稱:ApplicationInsights-Home,代碼行數:33,代碼來源:SubscribeController.cs

示例10: GetMetadata

 /// <summary>
 /// Generates a web request to return the user-defined metadata for this share.
 /// </summary>
 /// <param name="uri">The absolute URI to the share.</param>
 /// <param name="timeout">The server timeout interval.</param>
 /// <param name="accessCondition">The access condition to apply to the request.</param>
 /// <param name="useVersionHeader">A flag indicating whether to set the x-ms-version HTTP header.</param>
 /// <param name="operationContext">An <see cref="OperationContext" /> object for tracking the current operation.</param>
 /// <returns>A web request to use to perform the operation.</returns>
 public static HttpWebRequest GetMetadata(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)
 {
     UriQueryBuilder shareBuilder = GetShareUriQueryBuilder();
     HttpWebRequest request = HttpWebRequestFactory.GetMetadata(uri, timeout, shareBuilder, useVersionHeader, operationContext);
     request.ApplyAccessCondition(accessCondition);
     return request;
 }
開發者ID:jianghaolu,項目名稱:azure-storage-net,代碼行數:16,代碼來源:ShareHttpWebRequestFactory.cs

示例11: GetMetadata

 /// <summary>
 /// Generates a web request to return the user-defined metadata for this container.
 /// </summary>
 /// <param name="uri">The absolute URI to the container.</param>
 /// <param name="timeout">The server timeout interval.</param>
 /// <param name="accessCondition">The access condition to apply to the request.</param>
 /// <returns>A web request to use to perform the operation.</returns>
 public static HttpRequestMessage GetMetadata(Uri uri, int? timeout, AccessCondition accessCondition, HttpContent content, OperationContext operationContext)
 {
     UriQueryBuilder containerBuilder = GetContainerUriQueryBuilder();
     HttpRequestMessage request = HttpRequestMessageFactory.GetMetadata(uri, timeout, containerBuilder, content, operationContext);
     request.ApplyAccessCondition(accessCondition);
     return request;
 }
開發者ID:huoxudong125,項目名稱:azure-sdk-for-net,代碼行數:14,代碼來源:ContainerHttpRequestMessageFactory.cs

示例12: GetMetadata

 /// <summary>
 /// Generates a web request to return the user-defined metadata for this container.
 /// </summary>
 /// <param name="uri">The absolute URI to the container.</param>
 /// <param name="timeout">The server timeout interval.</param>
 /// <param name="accessCondition">The access condition to apply to the request.</param>
 /// <returns>A web request to use to perform the operation.</returns>
 public static StorageRequestMessage GetMetadata(Uri uri, int? timeout, AccessCondition accessCondition, HttpContent content, OperationContext operationContext, ICanonicalizer canonicalizer, StorageCredentials credentials)
 {
     UriQueryBuilder containerBuilder = GetContainerUriQueryBuilder();
     StorageRequestMessage request = HttpRequestMessageFactory.GetMetadata(uri, timeout, containerBuilder, content, operationContext, canonicalizer, credentials);
     request.ApplyAccessCondition(accessCondition);
     return request;
 }
開發者ID:tamram,項目名稱:azure-storage-net,代碼行數:14,代碼來源:ContainerHttpRequestMessageFactory.cs

示例13: ListBlobsSegmentedAsync

		public static async Task<ReadOnlyCollection<IListBlobItem>> ListBlobsSegmentedAsync(
			this CloudBlobDirectory container,
			bool useFlatBlobListing,
			int pageSize,
			BlobListingDetails details,
			BlobRequestOptions options,
			OperationContext operationContext,
			IProgress<IEnumerable<IListBlobItem>> progress = null,
			CancellationToken cancellationToken = default(CancellationToken)) {
			options = options ?? new BlobRequestOptions();
			var results = new List<IListBlobItem>();
			BlobContinuationToken continuation = null;
			BlobResultSegment segment;
			do {
				segment = await Task.Factory.FromAsync(
					(cb, state) => container.BeginListBlobsSegmented(useFlatBlobListing, details, pageSize, continuation, options, operationContext, cb, state).WithCancellation(cancellationToken),
					ar => container.EndListBlobsSegmented(ar),
					null);
				if (progress != null) {
					progress.Report(segment.Results);
				}
				results.AddRange(segment.Results);
				continuation = segment.ContinuationToken;
			} while (continuation != null);

			return new ReadOnlyCollection<IListBlobItem>(results);
		}
開發者ID:AArnott,項目名稱:Microsoft.WindowsAzure.StorageClient.Async,代碼行數:27,代碼來源:AzureBlobStorageExtensions.cs

示例14: WriteEntityContactMessage

        public void WriteEntityContactMessage()
        {
            var msg = new ContactMessage
            {
                From = new Contact
                {
                    ContactId = "A",
                    DisplayName = "Bob"
                },
                To = new Contact
                {
                    ContactId = "B",
                    DisplayName = "Jane"
                },
                MessageBody = "Test"
            };

            var context = new OperationContext();
            var proxy = new TableEntityProxy<ContactMessage>(msg);
            var props = proxy.WriteEntity(context);
            Assert.AreEqual("A", props["FromContactId"].StringValue);
            Assert.AreEqual("Bob", props["FromDisplayName"].StringValue);
            Assert.AreEqual("B", props["ToContactId"].StringValue);
            Assert.AreEqual("Jane", props["ToDisplayName"].StringValue);
        }
開發者ID:Genyus,項目名稱:candor-common,代碼行數:25,代碼來源:TableEntityProxyTests.cs

示例15: Delete

 /// <summary>
 /// Constructs a web request to delete the container and all of the blobs within it.
 /// </summary>
 /// <param name="uri">The absolute URI to the container.</param>
 /// <param name="timeout">The server timeout interval.</param>
 /// <param name="accessCondition">The access condition to apply to the request.</param>
 /// <param name="operationContext">An <see cref="OperationContext"/> object for tracking the current operation.</param>
 /// <returns>A web request to use to perform the operation.</returns>
 public static HttpWebRequest Delete(Uri uri, int? timeout, AccessCondition accessCondition, OperationContext operationContext)
 {
     UriQueryBuilder containerBuilder = GetContainerUriQueryBuilder();
     HttpWebRequest request = HttpWebRequestFactory.Delete(uri, containerBuilder, timeout, operationContext);
     request.ApplyAccessCondition(accessCondition);
     return request;
 }
開發者ID:huoxudong125,項目名稱:azure-sdk-for-net,代碼行數:15,代碼來源:ContainerHttpWebRequestFactory.cs


注:本文中的Microsoft.WindowsAzure.Storage.OperationContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。