public IEnumerable <TownCqiStat> QueryCurrentDateStats(DateTime currentDate, FrequencyBandType frequency) { var beginDate = currentDate.Date; var endDate = beginDate.AddDays(1); return (_repository.GetAllList( x => x.StatTime >= beginDate && x.StatTime < endDate && x.FrequencyBandType == frequency)); }
public CqiRegionDateView QueryLastDateCqi(DateTime initialDate, string city) { var stats = _cqiRepository.QueryLastDate(initialDate, (repository, beginDate, endDate) => { var query = _cqiRepository.GetAllList(x => x.StatTime >= beginDate & x.StatTime < endDate && x.FrequencyBandType == FrequencyBandType.All); return(query.FilterTownList(_townRepository.GetAllList().Where(x => x.CityName == city).ToList())); }); var townViews = stats.ConstructViews <TownCqiStat, TownCqiView>(_townRepository); return(townViews.QueryRegionDateView <CqiRegionDateView, DistrictCqiView, TownCqiView>(initialDate, DistrictCqiView.ConstructView)); }