Beispiel #1
0
        public async void Insert()
        {
            try
            {
                // Create the table client.
                CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

                // Create the CloudTable object that represents the "people" table.
                CloudTable table = tableClient.GetTableReference("myroomcommands");

                // Create a new customer entity.
                RoomCommand c = new RoomCommand("RELAY1", Guid.NewGuid().ToString());
                c.State = true;

                // Create the TableOperation object that inserts the customer entity.
                TableOperation insertOperation = TableOperation.Insert(c);

                // Execute the insert operation.
                await table.ExecuteAsync(insertOperation);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public async void Insert()
        {
            try
            {
                // Create the table client.
                CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

                // Create the CloudTable object that represents the "people" table.
                CloudTable table = tableClient.GetTableReference("myroomcommands");

                // Create a new customer entity.
                RoomCommand c = new RoomCommand("RELAY1", Guid.NewGuid().ToString());
                c.State = true;

                // Create the TableOperation object that inserts the customer entity.
                TableOperation insertOperation = TableOperation.Insert(c);

                // Execute the insert operation.
                await table.ExecuteAsync(insertOperation);
            }
            catch (Exception ex)
            {

                throw ex;
            }
           
        }