public virtual bool Equivalent(DatasourceRecord compare) { if (compare == null) { return(false); } if (this == compare) { return(true); } if (DatasourceId != compare.DatasourceId) { return(false); } if (Timestamp != compare.Timestamp) { return(false); } if (IntervalSeconds != compare.IntervalSeconds) { return(false); } if (Value == compare.Value) { return(false); } return(true); }
public static IEnumerable<DatasourceRecord> GenerateDummyData(int records) { var rand = new Random(); for (var i = 0; i < records; i++) { var dr = new DatasourceRecord { DatasourceId = _datasources[rand.Next(0, 2)], IntervalSeconds = rand.Next(60, 3600), Timestamp = DateTime.UtcNow.AddMilliseconds(i * 10), Value = (rand.NextDouble() * 100000) }; yield return dr; } }
public static IEnumerable <DatasourceRecord> GenerateDummyData(int records) { var rand = new Random(); for (var i = 0; i < records; i++) { var dr = new DatasourceRecord { DatasourceId = _datasources[rand.Next(0, 2)], IntervalSeconds = rand.Next(60, 3600), Timestamp = DateTime.UtcNow.AddMilliseconds(i * 10), Value = (rand.NextDouble() * 100000) }; yield return(dr); } }
public virtual bool Equivalent(DatasourceRecord compare) { if (compare == null) return false; if (this == compare) return true; if (DatasourceId != compare.DatasourceId) return false; if (Timestamp != compare.Timestamp) return false; if (IntervalSeconds != compare.IntervalSeconds) return false; if (Value == compare.Value) return false; return true; }