コード例 #1
0
        static void Main(string[] args)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnection"));

            CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

            CloudTable table = tableClient.GetTableReference("aliens");

            table.CreateIfNotExists();


            TableBatchOperation batch = new TableBatchOperation();

            var earthian1 = new Earthian("earny", "*****@*****.**");
            var earthian2 = new Earthian("bart", "*****@*****.**");
            var earthian3 = new Earthian("big-bird", "*****@*****.**");

            batch.Insert(earthian1);
            batch.Insert(earthian2);
            batch.Insert(earthian3);

            table.ExecuteBatch(batch);

            GetAllAliens(table);

            Console.ReadKey();
        }
コード例 #2
0
        static void DeleteAlien(CloudTable table, Earthian earthian)
        {
            TableOperation delete = TableOperation.Delete(earthian);

            table.Execute(delete);
        }
コード例 #3
0
        static void UpdateAlien(CloudTable table, Earthian earthian)
        {
            TableOperation update = TableOperation.Replace(earthian);

            table.Execute(update);
        }
コード例 #4
0
        static void CreateAlien(CloudTable table, Earthian earthian)
        {
            TableOperation insert = TableOperation.Insert(earthian);

            table.Execute(insert);
        }