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(); }
static void DeleteAlien(CloudTable table, Earthian earthian) { TableOperation delete = TableOperation.Delete(earthian); table.Execute(delete); }
static void UpdateAlien(CloudTable table, Earthian earthian) { TableOperation update = TableOperation.Replace(earthian); table.Execute(update); }
static void CreateAlien(CloudTable table, Earthian earthian) { TableOperation insert = TableOperation.Insert(earthian); table.Execute(insert); }