コード例 #1
0
 public void InsertSensorData(ISensorDataModel sensorDataModel)
 {
     using (var context = new SensorDataDB())
     {
         context.SensorData.Add((SensorDataModel)sensorDataModel);
         context.SaveChanges();
     }
 }
コード例 #2
0
        public IEnumerable <SensorDataModel> RetrieveAllData()
        {
            List <SensorDataModel> sensorDataModelList = new List <SensorDataModel>();

            using (var context = new SensorDataDB())
            {
                sensorDataModelList = context.SensorData.ToList();
            }

            return(sensorDataModelList);
        }