哪里" tableClient.CreateTableIfNotExist"在AzureStorage库V2? [英] Where is the "tableClient.CreateTableIfNotExist" in AzureStorage library v2?
问题描述
在Windows Azure存储,以前我们这样做是为了创建一个表:
In Windows Azure Storage, we used to do this to create a table :
var tableClient = account.CreateCloudTableClient();
tableClient.CreateTableIfNotExist(TableName);
我刚刚下载的Azure存储库(V2)的最后一个版本,我的previous code不工作了:
I just downloaded the last version of the azure storage library (v2), and my previous code doesn't work anymore :
Microsoft.WindowsAzure.Storage.Table.CloudTableClient'不
包含CreateTableIfNotExist'没有扩展名的定义
方法CreateTableIfNotExist接受式的第一个参数
Microsoft.WindowsAzure.Storage.Table.CloudTableClient'可以找到。
'Microsoft.WindowsAzure.Storage.Table.CloudTableClient' does not contain a definition for 'CreateTableIfNotExist' and no extension method 'CreateTableIfNotExist' accepting a first argument of type 'Microsoft.WindowsAzure.Storage.Table.CloudTableClient' could be found.
什么是V2良好的code?
What is the good code in v2 ?
推荐答案
在V2有一些重大的变动。
这里是新的code:
In v2 there's some breaking changes. Here's the new code :
var tableClient = account.CreateCloudTableClient();
// Create the table if it doesn't exist.
var cloudTable = tableClient.GetTableReference(TableName);
cloudTable.CreateIfNotExists();
一些好的输入:
- 如何使用表的存储服务: V1 0.7 并在 V2 。
- Windows Azure存储客户端库2.0重大更改和放大器;迁移指南从Azure存储小组
- How to use the Table Storage Service : in v1.7 and in v2.
- Windows Azure Storage Client Library 2.0 Breaking Changes & Migration Guide from the Azure Storage Team
这篇关于哪里" tableClient.CreateTableIfNotExist"在AzureStorage库V2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!