当前位置: 首页>>代码示例>>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;未经允许,请勿转载。