public IEnumerable <CityReportEntry> GetCityReports(IEnumerable <UnitEntry> UnitEntires)
        {
            var cityReports = UnitEntires
                              .GroupBy(x => CityKeyMap.GetCityKey(x.City))
                              .Select(x => new CityReportEntry()
            {
                City      = x.Key,
                SaleCount = x.Count()
            })
                              .OrderBy(x => x.City);

            return(cityReports);
        }
Exemplo n.º 2
0
        public IEnumerable <PricePointByKeyReportEntry> GetInventoryPricePointByCityReports(IEnumerable <UnitEntry> UnitEntires)
        {
            var groupedByCity = UnitEntires
                                .GroupBy(x => CityKeyMap.GetCityKey(x.City))
                                .Select(x => new {
                City  = x.Key,
                Units = x
            })
                                .OrderBy(x => x.City);

            return(groupedByCity
                   .Select(x => new PricePointByKeyReportEntry {
                Key = x.City,
                PricePointReports = GetInventoryPricePointReports(x.Units)
            }));
        }