本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Table.CloudTable.Create方法的典型用法代码示例。如果您正苦于以下问题:C# CloudTable.Create方法的具体用法?C# CloudTable.Create怎么用?C# CloudTable.Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.Storage.Table.CloudTable
的用法示例。
在下文中一共展示了CloudTable.Create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloudDal
public CloudDal()
{
// Retrieve the storage account from the connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
// Create the table client.
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
// Create the table if it doesn't exist.
table = tableClient.GetTableReference("people");
if (table.Exists()==false)
{
table.Create();
}
}
示例2: MyClassInitialize
public static void MyClassInitialize(TestContext testContext)
{
CloudTableClient tableClient = GenerateCloudTableClient();
currentTable = tableClient.GetTableReference(GenerateRandomTableName());
currentTable.CreateIfNotExists();
// Bulk Query Entities
for (int i = 0; i < 15; i++)
{
TableBatchOperation batch = new TableBatchOperation();
for (int j = 0; j < 100; j++)
{
var ent = GenerateRandomEnitity("tables_batch_" + i.ToString());
ent.RowKey = string.Format("{0:0000}", j);
batch.Insert(ent);
}
currentTable.ExecuteBatch(batch);
}
complexEntityTable = tableClient.GetTableReference(GenerateRandomTableName());
complexEntityTable.Create();
// Setup
TableBatchOperation complexBatch = new TableBatchOperation();
string pk = Guid.NewGuid().ToString();
for (int m = 0; m < 100; m++)
{
ComplexEntity complexEntity = new ComplexEntity(pk, string.Format("{0:0000}", m));
complexEntity.String = string.Format("{0:0000}", m);
complexEntity.Binary = new byte[] { 0x01, 0x02, (byte)m };
complexEntity.BinaryPrimitive = new byte[] { 0x01, 0x02, (byte)m };
complexEntity.Bool = m % 2 == 0 ? true : false;
complexEntity.BoolPrimitive = m % 2 == 0 ? true : false;
complexEntity.Double = m + ((double)m / 100);
complexEntity.DoublePrimitive = m + ((double)m / 100);
complexEntity.Int32 = m;
complexEntity.Int32N = m;
complexEntity.IntegerPrimitive = m;
complexEntity.IntegerPrimitiveN = m;
complexEntity.Int64 = (long)int.MaxValue + m;
complexEntity.LongPrimitive = (long)int.MaxValue + m;
complexEntity.LongPrimitiveN = (long)int.MaxValue + m;
complexEntity.Guid = Guid.NewGuid();
complexBatch.Insert(complexEntity);
if (m == 50)
{
middleRef = complexEntity;
}
// Add delay to make times unique
Thread.Sleep(100);
}
complexEntityTable.ExecuteBatch(complexBatch);
}