Created
March 6, 2018 23:16
-
-
Save dstarr/ebc3d7b31bdacf1a46a7b3019b3008bf to your computer and use it in GitHub Desktop.
Simple Entity for Sensor Data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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