public async Task <TableDeviceReading> ReadItem(string documentId, string deviceId) { TableOperation retrieveOperation = TableOperation.Retrieve <TableDeviceReading>(deviceId, documentId); TableResult result = await table.ExecuteAsync(retrieveOperation); TableDeviceReading customer = result.Result as TableDeviceReading; return(customer); }
public async Task UpdateItem(TableDeviceReading reading) { TableOperation retrieveOperation = TableOperation.Retrieve <TableDeviceReading>(reading.PartitionKey, reading.RowKey); TableResult result = await table.ExecuteAsync(retrieveOperation); TableDeviceReading customer = result.Result as TableDeviceReading; customer.MetricValue = 200; TableOperation mergeOperation = TableOperation.Merge(customer); await table.ExecuteAsync(mergeOperation); }