Skip to content

Instantly share code, notes, and snippets.

@dstarr
Created March 6, 2018 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstarr/ebc3d7b31bdacf1a46a7b3019b3008bf to your computer and use it in GitHub Desktop.
Save dstarr/ebc3d7b31bdacf1a46a7b3019b3008bf to your computer and use it in GitHub Desktop.
Simple Entity for Sensor Data
public class SensorTick
{
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }
[JsonProperty(PropertyName = "temperature")]
public int Temperature { get; set; }
[JsonProperty(PropertyName = "humidity")]
public int Humidity { get; set; }
[JsonConverter(typeof(IsoDateTimeConverter))]
[JsonProperty("timeStamp")]
public DateTime TimeStamp { get; set; }
[JsonProperty(PropertyName = "sensorName")]
public String SensorName { get; set; }
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment