public GetAllDataPointsInfoResponse GetAllDataPointInfo() { GetAllDataPointsInfoResponse response = new GetAllDataPointsInfoResponse(); try { IEnumerable <DataPoint> allDataPoints = _dataPointRepository.FindAll(); response.DataPointInfoViews = allDataPoints.ConverToDataPointInfoViews(); } catch (Exception ex) { string message = "查询失败!\n错误信息:\n" + ex.Message; response = new GetAllDataPointsInfoResponse() { ResponseSucceed = false, Message = "查询失败" }; LoggingFactory.GetLogger().WriteDebugLogger(message); return(response); } return(response); }
public void SaveAndLoad() { var dataPoint = new DataPoint { ReceivedTimestampUtc = new DateTime(2001, 2, 3, 4, 5, 6), SensorTimestampUtc = new DateTime(2001, 2, 3, 4, 5, 6), SensorType = "MyTestSensor", StationId = "MyStationId" }; _repository.Save(dataPoint); var allValues = _repository.FindAll(); allValues.Should().HaveCount(1); }
public void InitializeData() { this.allDataPoints = dataPointRepository.FindAll().ToList(); }