private void GroupComicsByRange() { Dictionary <int, decimal> values = GetPrices(); var priceGroups = from pair in values group pair.Key by Purchases.EvaluatePrice(pair.Value) into priceGroup orderby priceGroup.Key descending select priceGroup; foreach (var group in priceGroups) { string message = String.Format("I found {0} {1} comics: issue ", group.Count(), group.Key); foreach (var issueNumber in group) { message += $"{issueNumber.ToString()} "; } CurrentQueryResults.Add(CreateAnonymousListViewItem(message, "captain_amazing_250x250.jpg")); } }