public IEnumerable <TownDoubleFlowView> QueryLastDateView(DateTime initialDate, FrequencyBandType frequency = FrequencyBandType.All) { var stats = _repository.QueryLastDate(initialDate, (repository, beginDate, endDate) => repository.GetAllList(x => x.StatTime >= beginDate && x.StatTime < endDate && x.FrequencyBandType == frequency) .OrderBy(x => x.StatTime) .ToList()); return(stats.Select(x => x.ConstructView <TownDoubleFlow, TownDoubleFlowView>(_townRepository))); }
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)); }