public IEnumerable <AreaTestFileView> QueryRoadTestInfos(DateTime begin, DateTime end, InfrastructureInfo road) { var allInfos = _areaTestInfoRepository.GetAllList(x => x.TownId == road.Id); var views = from info in allInfos join file in _fileInfoRepository.GetAllList() on info.FileId equals file.Id where file.TestDate >= begin && file.TestDate < end select new { Info = info, File = file }; return(views.Select(v => { var view = v.Info.MapTo <AreaTestFileView>(); view.AreaName = road.HotspotName; view.CsvFileName = v.File.CsvFileName; view.TestDate = v.File.TestDate; return view; })); }
public IEnumerable <CsvFilesInfo> QueryFilesInfos(DateTime begin, DateTime end) { return(_dtFileInfoRepository.GetAllList(x => x.TestDate >= begin && x.TestDate < end)); }