Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Community Bloggers

Using Where and Group in Linq

I tried lots of Google time to find the answer to this and failed (my google searching may also suck :) so in trying to tie a Where and GroupBy together in a Linq query I used the following. var values = from p in tbl_data where p.some_other_value == 'hello world' select p; var group_values = values.GroupBy(p => p.a_value).ToList(); I've seen lots of queries that place the groupby in the from and but never with a Where, there may be a nicer way of doing it but the above works for me :) Read More...
Published Friday, May 16, 2008 7:53 AM by Andrew Stopford's Weblog
Filed under: ,

Comments

No Comments
Anonymous comments are disabled

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us