开发者

How to group select new GetTable<>?

DataContext db = new DataContext(conString);
var dvd = db.GetTable<DvdList>();
var query = from b in dvd
            group b by b.CategoryId into g
            select new { CategoryId = g.Key, GetTable<DvdList>()= g };

The error occurs at 开发者_如何学编程GetTable<DvdList>()= g


Your syntax makes no sense whatsoever.

If you just want the contents of the group, you don't need a select clause at all; the group clause returns a set of IGrouping<String, DvdList> that is itself a set of DVDs.


GetTable<DvdList>()= g is syntactically invalid. The left side declares the name of the property in the anonymous type that is created. <, >, ( and ) are invalid characters inside the name of a property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜