Linq GroupBy ToDictionary

Dictionary<string, List<CustomObject>>  dic= objList
    .GroupBy(o => o.PropertyName)
    .ToDictionary(g => g.Key, g => g.ToList());
posted @ 2014-07-01 19:28  zhh  阅读(2213)  评论(0编辑  收藏  举报