output-service-tsdb/Models/MeasurementObject.cs

31 lines
745 B
C#
Raw Normal View History

2020-04-08 02:58:29 +02:00
using System;
using InfluxDB.Client.Core;
2020-04-08 15:48:56 +02:00
namespace OutputServiceTSDB.Models
2020-04-08 02:58:29 +02:00
{
2020-04-08 15:48:56 +02:00
[Measurement("result")]
2020-04-08 02:58:29 +02:00
public class MeasurementObject
{
[Column("deviceid", IsTag = true)]
public string DeviceID { get; set; }
private double _probability;
[Column("probability")]
public double Probability
{
get => _probability;
set
{
if (value > 1.0 || value < 0.0)
throw new ArgumentOutOfRangeException(
$"{nameof(value)} must be between 0 and 1.");
else
_probability = value;
}
}
[Column(IsTimestamp = true)] public DateTime Time;
}
}