本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Table.CloudTable.DeleteIfExists方法的典型用法代码示例。如果您正苦于以下问题:C# CloudTable.DeleteIfExists方法的具体用法?C# CloudTable.DeleteIfExists怎么用?C# CloudTable.DeleteIfExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.Storage.Table.CloudTable
的用法示例。
在下文中一共展示了CloudTable.DeleteIfExists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AzureTableStoragePerformanceTests
public AzureTableStoragePerformanceTests()
{
try
{
_logger = LogManager.GetLogger(TargetTableName);
var storageAccount = GetStorageAccount();
// Create the table client.
var tableClient = storageAccount.CreateCloudTableClient();
//create charts table if not exists.
_cloudTable = tableClient.GetTableReference(TargetTableName);
_cloudTable.DeleteIfExists();
_cloudTable.CreateIfNotExists();
}
catch (Exception ex)
{
throw new Exception("Failed to initialize tests, make sure Azure Storage Emulator is running.", ex);
}
}
开发者ID:abkonsta,项目名称:NLog.Extensions.AzureTableStorage,代码行数:18,代码来源:AzureTableStoragePerformanceTests.cs
示例2: Initialize
public static void Initialize(TestContext context)
{
ConnectionStringSettingsCollection settings =
ConfigurationManager.ConnectionStrings;
ConnectionStringSettings connectionStringSettings = settings["Azure"];
var builder = new DbConnectionStringBuilder
{
ConnectionString = connectionStringSettings.ConnectionString
};
accountName = (string) builder["AccountName"];
accountKey = (string) builder["AccountKey"];
var account = CloudStorageAccount.Parse(connectionStringSettings.ConnectionString);
CloudTableClient tableClient = account.CreateCloudTableClient();
// Create Table
table = tableClient.GetTableReference(TableName);
var b = table.DeleteIfExists();
Console.WriteLine(string.Format("deleted table {0}: {1}", TableName, b));
table.CreateIfNotExists();
// Insert Entity
var person = new ContactEntity("Peter", "Ritchie") { Email = "[email protected]", PhoneNumber = "555-0123" };
table.Execute(TableOperation.Insert(person));
}
示例3: DeleteAzureTable
public static void DeleteAzureTable(CloudTable table)
{
table.DeleteIfExists();
}
示例4: OnStart
public override bool OnStart()
{
ServicePointManager.DefaultConnectionLimit = 5000;
command.Clear();
// Gracefully stop crawling
crawlHtml = false;
crawlXml = false;
crawlUrl.Clear();
xmls.Clear();
urls.Clear();
disallow.Clear();
while (answers.PeekMessage() != null)
{
answers.DeleteMessage(answers.GetMessage());
}
while (command.PeekMessage() != null)
{
command.DeleteMessage(answers.GetMessage());
}
table = tableClient.GetTableReference("sites" + guid);
errorTable = tableClient.GetTableReference("errors" + guid);
table.DeleteIfExists();
errorTable.DeleteIfExists();
guid = Guid.NewGuid().ToString().Substring(0, 5);
table = tableClient.GetTableReference("sites" + guid);
errorTable = tableClient.GetTableReference("errors" + guid);
table.CreateIfNotExists();
errorTable.CreateIfNotExists();
siteEntries = 0;
return base.OnStart();
}