Example #1
0
        public HttpResponseMessage Post([FromBody] SensorReading sensorReading)
        {
            TableStorageProvider <SensorReadingEntry> storageProvider = new TableStorageProvider <SensorReadingEntry>("SensorData");

            SensorReadingEntry sre = new SensorReadingEntry();

            sre.RowKey   = sensorReading.SensorName;
            sre.Value    = sensorReading.Value;
            sre.UtcTicks = DateTime.UtcNow.Ticks;
            storageProvider.Insert(sre);

            return(Request.CreateResponse <SensorReading>(HttpStatusCode.OK, sensorReading));
        }