Example #1
0
        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);
        }
Example #2
0
        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);
        }