This project is read-only.
1

Closed

GroupBy problems

description

Use Northwind database for testing , there are many problems, such as :
1、GroupBy
var list = this.dStore.Query<Customer>()
    .Where(c => c.City == "London" || c.City == "Sao Paulo")
    .GroupBy(c => c.City).Select(g => new
    {
        g.Key,
        g
    }).ToList();
Closed Jul 14, 2014 at 2:53 AM by iamkrillin

comments

iamkrillin wrote Jul 14, 2014 at 2:52 AM

The above scenario will work so long as you project what you need to into a new anonymous object (without navigation properties such as g in your example)
var list = this.dStore.Query<Customer>()
    .Where(c => c.City == "London" || c.City == "Sao Paulo")
    .GroupBy(c => c.City).Select(g => new
    {
        g.Key,
        Count = g.Count()
    }).ToList();
Navigation properties are something that I have no plans to support now or at anytime in the near future.

wrote Jul 14, 2014 at 2:53 AM

wrote Jul 14, 2014 at 2:53 AM

wrote Dec 8 at 8:30 AM