public void InsertSensorData(ISensorDataModel sensorDataModel) { using (var context = new SensorDataDB()) { context.SensorData.Add((SensorDataModel)sensorDataModel); context.SaveChanges(); } }
public IEnumerable <SensorDataModel> RetrieveAllData() { List <SensorDataModel> sensorDataModelList = new List <SensorDataModel>(); using (var context = new SensorDataDB()) { sensorDataModelList = context.SensorData.ToList(); } return(sensorDataModelList); }