public async Task <IEnumerable <StationType> > GetAllStationTypes() { try { IStationTypeDao stationDao = GetIStationTypeDao(); return(await stationDao.FindAllAsync()); } catch (Exception) { return(null); } }
public StationManager(IStationDao stationDao, IStationTypeDao stationTypeDao, IMeasurementDao measurementDao) { this.stationDao = stationDao; this.stationTypeDao = stationTypeDao; this.measurementDao = measurementDao; }
private static IStationTypeDao GetIStationTypeDao() { return(_iStationTypeDao ?? (_iStationTypeDao = new AdoStationTypeDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName)))); }
public async Task <IHttpActionResult> GetStationTypes() { IStationTypeDao dao = AdoFactory.Instance.GetStationTypeDao("wetr"); return(Ok(await dao.FindAllAsync())); }