public IEnumerable <TownDoubleFlow> 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 DoubleFlowRegionDateView QueryLastDateStat(DateTime initialDate, string city) { var stats = _statRepository.QueryLastDate(initialDate, (repository, beginDate, endDate) => { var query = _statRepository.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 <TownDoubleFlow, TownDoubleFlowView>(_townRepository); return(townViews.QueryRegionDateView <DoubleFlowRegionDateView, DistrictDoubleFlowView, TownDoubleFlowView>( initialDate, DistrictDoubleFlowView.ConstructView)); }