本文整理汇总了C#中BlobServiceClient.GetBlobMetadataAsync方法的典型用法代码示例。如果您正苦于以下问题:C# BlobServiceClient.GetBlobMetadataAsync方法的具体用法?C# BlobServiceClient.GetBlobMetadataAsync怎么用?C# BlobServiceClient.GetBlobMetadataAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlobServiceClient
的用法示例。
在下文中一共展示了BlobServiceClient.GetBlobMetadataAsync方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBlobMetadataAsync_InvalidLeaseProvided_ThrowsArgumentException
public async void GetBlobMetadataAsync_InvalidLeaseProvided_ThrowsArgumentException()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
await client.GetBlobMetadataAsync(containerName, blobName, InvalidLeaseId);
// throws exception
}
示例2: GetBlobMetadataAsync_LeasedBlobWithMetadataNoLeaseProvided_GetsMetadata
public async void GetBlobMetadataAsync_LeasedBlobWithMetadataNoLeaseProvided_GetsMetadata()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
var expectedMetadata = new Dictionary<string, string>
{
{"CaptainAmerica", "Shield"},
{"Thor", "Hammer"},
{"Me", "Code"}
};
_util.CreateContainer(containerName);
_util.CreateBlockBlob(containerName, blobName, expectedMetadata);
_util.LeaseBlob(containerName, blobName);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
var response = await client.GetBlobMetadataAsync(containerName, blobName);
Assert.AreEqual(expectedMetadata, response.Metadata);
}
示例3: BlobServiceClient
public async void GetBlobMetadataAsync_LeasedBlobWithMetadataIncorrectLeaseProvided_ThrowsLeaseIdMismatchWithBlobOperationAzureException()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
var expectedMetadata = new Dictionary<string, string>
{
{"CaptainAmerica", "Shield"},
{"Thor", "Hammer"},
{"Me", "Code"}
};
_util.CreateContainer(containerName);
_util.CreateBlockBlob(containerName, blobName, expectedMetadata);
_util.LeaseBlob(containerName, blobName);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
await client.GetBlobMetadataAsync(containerName, blobName, FakeLeaseId);
// throws exception
}
示例4: GetBlobMetadataAsync_ExistingBlobWithNoMetadata_GetsEmptyMetadata
public async void GetBlobMetadataAsync_ExistingBlobWithNoMetadata_GetsEmptyMetadata()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
var expectedMetadata = new Dictionary<string, string>();
_util.CreateContainer(containerName);
_util.CreateBlockBlob(containerName, blobName);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
var response = await client.GetBlobMetadataAsync(containerName, blobName);
Assert.AreEqual(expectedMetadata, response.Metadata);
}