<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to Use Grouping in C# LINQ Syntax</title>
	<atom:link href="http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/</link>
	<description></description>
	<lastBuildDate>Thu, 29 Sep 2011 17:23:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: JW</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-1864</link>
		<dc:creator>JW</dc:creator>
		<pubDate>Tue, 18 Jan 2011 18:29:21 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-1864</guid>
		<description>Great explination, clear english ;-) butt the..

Code is wrong )-;          [group.Key, group.Count()]
               should be   [group.Count(), group.Key]

  1 employees report to 2?

            var emp1 = new { ReportsTo = &quot;Jim&quot;, LastName = &quot;Richard&quot; };
            var emp2 = new { ReportsTo = &quot;Jim&quot;, LastName = &quot;Christopher&quot; };
            var emp3 = new { ReportsTo = &quot;Bob&quot;, LastName = &quot;John&quot; };
            var emp4 = new { ReportsTo = &quot;Bob&quot;, LastName = &quot;Greg&quot; };
            var employees = new[] { emp1, emp2, emp3, emp4 };

            var groups =
              from employee in employees
              group employee by employee.ReportsTo;

            foreach (var group in groups)
                Console.WriteLine(&quot;{0} employees report to {1}.&quot;,  group.Count(), group.Key);</description>
		<content:encoded><![CDATA[<p>Great explination, clear english <img src='http://www.richardbushnell.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  butt the..</p>
<p>Code is wrong )-;          [group.Key, group.Count()]<br />
               should be   [group.Count(), group.Key]</p>
<p>  1 employees report to 2?</p>
<p>            var emp1 = new { ReportsTo = &#8220;Jim&#8221;, LastName = &#8220;Richard&#8221; };<br />
            var emp2 = new { ReportsTo = &#8220;Jim&#8221;, LastName = &#8220;Christopher&#8221; };<br />
            var emp3 = new { ReportsTo = &#8220;Bob&#8221;, LastName = &#8220;John&#8221; };<br />
            var emp4 = new { ReportsTo = &#8220;Bob&#8221;, LastName = &#8220;Greg&#8221; };<br />
            var employees = new[] { emp1, emp2, emp3, emp4 };</p>
<p>            var groups =<br />
              from employee in employees<br />
              group employee by employee.ReportsTo;</p>
<p>            foreach (var group in groups)<br />
                Console.WriteLine(&#8220;{0} employees report to {1}.&#8221;,  group.Count(), group.Key);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mathieson</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-530</link>
		<dc:creator>Mathieson</dc:creator>
		<pubDate>Fri, 09 Jul 2010 23:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-530</guid>
		<description>evlin, like is actually a subquery that returns a boolean value.  In LINQ you can use any function that does that in the where function/clause.  To replicate LIKE %mr%, for example, you can do 
from l in list
where l.Title.Contains(&quot;mr&quot;)
select l.Title

but it&#039;s much more flexible than that.</description>
		<content:encoded><![CDATA[<p>evlin, like is actually a subquery that returns a boolean value.  In LINQ you can use any function that does that in the where function/clause.  To replicate LIKE %mr%, for example, you can do<br />
from l in list<br />
where l.Title.Contains(&#8220;mr&#8221;)<br />
select l.Title</p>
<p>but it&#8217;s much more flexible than that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Anderson</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-74</link>
		<dc:creator>Mike Anderson</dc:creator>
		<pubDate>Thu, 17 Dec 2009 11:31:26 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-74</guid>
		<description>Excellent! I&#039;ve just started trying to do come more complex reporting in LINQ instead of T-SQL, and its actually working thanks to your article. ;D</description>
		<content:encoded><![CDATA[<p>Excellent! I&#8217;ve just started trying to do come more complex reporting in LINQ instead of T-SQL, and its actually working thanks to your article. ;D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Argentino</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-73</link>
		<dc:creator>Argentino</dc:creator>
		<pubDate>Wed, 04 Nov 2009 04:32:58 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-73</guid>
		<description>Thanks! Very useful!</description>
		<content:encoded><![CDATA[<p>Thanks! Very useful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gideon</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-72</link>
		<dc:creator>Gideon</dc:creator>
		<pubDate>Fri, 04 Sep 2009 07:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-72</guid>
		<description>Thanks for the article.  Some of the other linq features frustrated me, so I decided to read the manual before using this one.</description>
		<content:encoded><![CDATA[<p>Thanks for the article.  Some of the other linq features frustrated me, so I decided to read the manual before using this one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marwan</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-71</link>
		<dc:creator>Marwan</dc:creator>
		<pubDate>Mon, 24 Aug 2009 12:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-71</guid>
		<description>brilliant article i was going nuts trying to understand the group by until i read this!

cheers</description>
		<content:encoded><![CDATA[<p>brilliant article i was going nuts trying to understand the group by until i read this!</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-70</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Wed, 11 Mar 2009 17:35:21 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-70</guid>
		<description>Excellent article. Thanks</description>
		<content:encoded><![CDATA[<p>Excellent article. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: evlin</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-69</link>
		<dc:creator>evlin</dc:creator>
		<pubDate>Wed, 11 Feb 2009 14:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-69</guid>
		<description>nice article..

in sql we usually use &quot;select * from table where field like &#039;%%&#039;&quot;

so, Could i use syntax &quot;like&quot; in linq?? thanks ^^</description>
		<content:encoded><![CDATA[<p>nice article..</p>
<p>in sql we usually use &#8220;select * from table where field like &#8216;%%&#8217;&#8221;</p>
<p>so, Could i use syntax &#8220;like&#8221; in linq?? thanks ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oli</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-68</link>
		<dc:creator>Oli</dc:creator>
		<pubDate>Tue, 28 Oct 2008 09:08:11 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-68</guid>
		<description>Thanks for writing it up. I was also initially very confused by expecting this to work in a similar way to grouping with T-SQL.</description>
		<content:encoded><![CDATA[<p>Thanks for writing it up. I was also initially very confused by expecting this to work in a similar way to grouping with T-SQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-67</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 21:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-67</guid>
		<description>pretty good article … you should go on explain all these Linq stuff.
Thanks, Chris</description>
		<content:encoded><![CDATA[<p>pretty good article … you should go on explain all these Linq stuff.<br />
Thanks, Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ulu</title>
		<link>http://www.richardbushnell.net/2008/02/08/how-to-use-grouping-in-c-linq-syntax/comment-page-1/#comment-66</link>
		<dc:creator>ulu</dc:creator>
		<pubDate>Thu, 27 Mar 2008 13:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/08/how-to-use-grouping-in-c-linq-syntax/#comment-66</guid>
		<description>Do you know how to get these results in VB?

I&#039;m trying to use LINQ syntax but I get IEnumerable&#039;s of anonymous types. I&#039;m trying to translate this query:
source.GroupBy(Of Boolean)(Function(x) x.MyBoolProperty).
In C# it should be smth like
source.GroupBy(x =&gt; x.MyBoolProperty).

Perhaps you should mention that not all GroupBy overloads return IEnumerable of IGrouping..

ulu</description>
		<content:encoded><![CDATA[<p>Do you know how to get these results in VB?</p>
<p>I&#8217;m trying to use LINQ syntax but I get IEnumerable&#8217;s of anonymous types. I&#8217;m trying to translate this query:<br />
source.GroupBy(Of Boolean)(Function(x) x.MyBoolProperty).<br />
In C# it should be smth like<br />
source.GroupBy(x =&gt; x.MyBoolProperty).</p>
<p>Perhaps you should mention that not all GroupBy overloads return IEnumerable of IGrouping..</p>
<p>ulu</p>
]]></content:encoded>
	</item>
</channel>
</rss>

