當前位置: 首頁>>代碼示例>>C#>>正文


C# CloudTable.DeleteIfExists方法代碼示例

本文整理匯總了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));
        }
開發者ID:peteraritchie,項目名稱:RestCloudTable,代碼行數:24,代碼來源:RestCloudTableExistingDataTests.cs

示例3: DeleteAzureTable

 public static void DeleteAzureTable(CloudTable table)
 {
     table.DeleteIfExists();
 }
開發者ID:sbidy,項目名稱:iot-journey,代碼行數:4,代碼來源:AzureStorageHelpers.cs

示例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();
        }
開發者ID:patrickchiang,項目名稱:Crawler,代碼行數:43,代碼來源:WorkerRole.cs


注:本文中的Microsoft.WindowsAzure.Storage.Table.CloudTable.DeleteIfExists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。