开发者

Querying from a collection of type ObservableCollection<Dictionary<string, object>>

开发者 https://www.devze.com 2023-01-23 08:57 出处:网络
I have a Collection of type ObservableCollection<Dictionary<string, object>> and one of its properties is \'Group\'. How do I write a linq to query all items where \"Group == \'SomeGroup\'

I have a Collection of type ObservableCollection<Dictionary<string, object>> and one of its properties is 'Group'. How do I write a linq to query all items where "Group == 'SomeGroup'"? I want a list that I can bind to a silverlight grid.开发者_开发技巧


Could you may be post some of the code that you used? Without it this is what comes to mind:

var a = (from m in collection
               from b in m.Values
               where b.Group == "Some Group"
               select b).ToList();

Hope it helps

0

精彩评论

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