• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Storage.OperationContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.WindowsAzure.Storage.OperationContext的典型用法代码示例。如果您正苦于以下问题:C# OperationContext类的具体用法?C# OperationContext怎么用?C# OperationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OperationContext类属于Microsoft.WindowsAzure.Storage命名空间,在下文中一共展示了OperationContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Send

        /// <summary>
        /// Sends the given <see cref="TransportMessage"/> to the queue with the specified globally addressable name
        /// </summary>
        public async Task Send(string destinationAddress, TransportMessage message, ITransactionContext context)
        {
            context.OnCommitted(async () =>
            {
                var headers = message.Headers.Clone();
                var queue = GetQueue(destinationAddress);
                var messageId = Guid.NewGuid().ToString();
                var popReceipt = Guid.NewGuid().ToString();
                var timeToBeReceivedOrNull = GetTimeToBeReceivedOrNull(headers);
                var queueVisibilityDelayOrNull = GetQueueVisibilityDelayOrNull(headers);
                var cloudQueueMessage = Serialize(messageId, popReceipt, headers, message.Body);

                try
                {
                    var options = new QueueRequestOptions {RetryPolicy = new ExponentialRetry()};
                    var operationContext = new OperationContext();

                    await queue.AddMessageAsync(cloudQueueMessage, timeToBeReceivedOrNull, queueVisibilityDelayOrNull, options, operationContext);
                }
                catch (Exception exception)
                {
                    throw new RebusApplicationException(exception, $"Could not send message with ID {cloudQueueMessage.Id} to '{destinationAddress}'");
                }
            });
        }
开发者ID:RichieYang,项目名称:Rebus,代码行数:28,代码来源:AzureStorageQueuesTransport.cs


示例17: ReadEntity

        public override void ReadEntity(IDictionary<string,EntityProperty> properties, OperationContext operationContext)
        {
            base.ReadEntity(properties, operationContext);

            try
            {
                if ((this.EncryptionVersion.HasValue && this.EncryptionVersion.Value > 0))
                {
                    AzureTableCrypto.Get().DecryptObject(this.EncryptionVersion.Value, this);
                }
            }
            catch (FormatException fe)
            {
                //FormatException gets thrown when the data is not properly Base-64 encoded

                throw new AzureTableCryptoDecryptionException(this, "Error decrypting table service entity", fe);
            }
            catch (CryptographicException ce)
            {
                throw new AzureTableCryptoDecryptionException(this, "Error decrypting table service entity", ce);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
开发者ID:justin,项目名称:AzureTableEncryption,代码行数:26,代码来源:EncryptableTableEntity.cs


示例18: Delete

 /// <summary>
 /// Constructs a web request to delete the directory and all of the files within it.
 /// </summary>
 /// <param name="uri">The absolute URI to the directory.</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 boolean value indicating whether to set the <i>x-ms-version</i> HTTP header.</param>
 /// <param name="operationContext">An <see cref="OperationContext" /> object for tracking the current operation.</param>
 /// <returns>A <see cref="System.Net.HttpWebRequest"/> object.</returns>
 public static HttpWebRequest Delete(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)
 {
     UriQueryBuilder directoryBuilder = GetDirectoryUriQueryBuilder();
     HttpWebRequest request = HttpWebRequestFactory.Delete(uri, directoryBuilder, timeout, useVersionHeader, operationContext);
     request.ApplyAccessCondition(accessCondition);
     return request;
 }
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:16,代码来源:DirectoryHttpWebRequestFactory.cs


示例19: ListBlobsSegmented

 public BlobResultSegment ListBlobsSegmented(string prefix, bool useFlatListing, BlobListingDetails blobListingDetails,
     int? maxResults, BlobContinuationToken continuationToken, BlobRequestOptions blobRequestOptions,
     OperationContext operationContext)
 {
     return _client.ListBlobsSegmented(prefix, useFlatListing, blobListingDetails, maxResults, continuationToken,
         blobRequestOptions, operationContext);
 }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:7,代码来源:AzureCloudBlobClient.cs


示例20: Delete

 /// <summary>
 /// Constructs a web request to delete the share and all of the files within it.
 /// </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>
 /// <returns>A web request to use to perform the operation.</returns>
 public static HttpRequestMessage Delete(Uri uri, int? timeout, AccessCondition accessCondition, HttpContent content, OperationContext operationContext)
 {
     UriQueryBuilder shareBuilder = GetShareUriQueryBuilder();
     HttpRequestMessage request = HttpRequestMessageFactory.Delete(uri, timeout, shareBuilder, content, operationContext);
     request.ApplyAccessCondition(accessCondition);
     return request;
 }
开发者ID:jianghaolu,项目名称:azure-storage-net,代码行数:14,代码来源:ShareHttpRequestMessageFactory.cs



注:本文中的Microsoft.WindowsAzure.Storage.OperationContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Auth.StorageCredentials类代码示例发布时间:2022-05-26
下一篇:
C# Storage.CloudStorageAccount类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap