private void btnRetStorageTableData_Click(object sender, EventArgs e) { //init the storage table var storTable = new AzureStorage.Tables(Properties.Settings.Default.AzureConnection); //retrieve from the storage table var stTableObj = storTable.Retrieve<TestObject>("UnitTestTable", tbRowKey.Text, tbPartitionKey.Text); //show the data in the text box tbStResView.Text = JsonConvert.SerializeObject(stTableObj); }
private void btnRetStorageTableData_Click(object sender, EventArgs e) { //init the storage table var storTable = new AzureStorage.Tables(Properties.Settings.Default.AzureConnection); //retrieve from the storage table var stTableObj = storTable.Retrieve <TestObject>("UnitTestTable", tbRowKey.Text, tbPartitionKey.Text); //show the data in the text box tbStResView.Text = JsonConvert.SerializeObject(stTableObj); }
private void btnStInsert_Click(object sender, EventArgs e) { //build some test data to save into the storage table var testData = new TestObject() { intProperty = 1, stringProperty = "test string", boolProperty = false, datetimeOffsetProperty = DateTimeOffset.Now, dateTimeProperty = DateTime.Now, doubleProperty = 12.34, guidProperty = Guid.NewGuid(), binaryProperty = Encoding.ASCII.GetBytes("test binary"), PartitionKey = tbPartitionKey.Text, RowKey = tbRowKey.Text }; //init the storage table var storTable = new AzureStorage.Tables(Properties.Settings.Default.AzureConnection); //add the data or update it to the storage table storTable.InsertOrReplace("UnitTestTable", testData); }