本文整理匯總了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();
}