<?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: 7 tricks to simplify your programs with LINQ</title>
	<atom:link href="http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/feed/" rel="self" type="application/rss+xml" />
	<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/</link>
	<description>On programming, technology, and random things of interest</description>
	<lastBuildDate>Thu, 29 Jul 2010 00:28:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: May 20th Links: ASP.NET, ASP.NET AJAX, .NET, Visual Studio, Silverlight, WPF &#124; OOP &#8211; Object Oriented Programing</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-908</link>
		<dc:creator>May 20th Links: ASP.NET, ASP.NET AJAX, .NET, Visual Studio, Silverlight, WPF &#124; OOP &#8211; Object Oriented Programing</dc:creator>
		<pubDate>Tue, 04 May 2010 05:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-908</guid>
		<description>[...] 7 Ways to Simplify your code with LINQ: Igor Ostrovsky has a great blog post that talks about new code techniques you can use to improve your code using .NET 3.5 and the new language and LINQ features in it. [...]</description>
		<content:encoded><![CDATA[<p>[...] 7 Ways to Simplify your code with LINQ: Igor Ostrovsky has a great blog post that talks about new code techniques you can use to improve your code using .NET 3.5 and the new language and LINQ features in it. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LINQ: Language-Integrated Query &#171; Rams On It &#8211; .NET</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-845</link>
		<dc:creator>LINQ: Language-Integrated Query &#171; Rams On It &#8211; .NET</dc:creator>
		<pubDate>Fri, 02 Apr 2010 00:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-845</guid>
		<description>[...] 7 tricks to simplify your programs with LINQ LINQ Learning Guide: LINQ to SQL [...]</description>
		<content:encoded><![CDATA[<p>[...] 7 tricks to simplify your programs with LINQ LINQ Learning Guide: LINQ to SQL [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ControlFlow</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-756</link>
		<dc:creator>ControlFlow</dc:creator>
		<pubDate>Sun, 21 Feb 2010 15:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-756</guid>
		<description>Another way to concat string from the chars sequence:
&lt;code&gt;
xs.Aggregate(new StringBuilder(), (b, c) =&gt; b.Append(c), b =&gt; b.ToString())
&lt;/code&gt;
Maybe it&#039;s performance better than suggested string.Join() or string(char[]) ctor usages...</description>
		<content:encoded><![CDATA[<p>Another way to concat string from the chars sequence:<br />
<code><br />
xs.Aggregate(new StringBuilder(), (b, c) =&gt; b.Append(c), b =&gt; b.ToString())<br />
</code><br />
Maybe it&#8217;s performance better than suggested string.Join() or string(char[]) ctor usages&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HitEmUp - Source code of my MIX 10K Challenge Entry - Kingherc&#39;s .NET (and you&#39;re caught in it)</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-653</link>
		<dc:creator>HitEmUp - Source code of my MIX 10K Challenge Entry - Kingherc&#39;s .NET (and you&#39;re caught in it)</dc:creator>
		<pubDate>Sat, 30 Jan 2010 21:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-653</guid>
		<description>[...] notation for usual procedures (searching, looping, replacing etc.) is possible. See this handy post for more on LINQ [...]</description>
		<content:encoded><![CDATA[<p>[...] notation for usual procedures (searching, looping, replacing etc.) is possible. See this handy post for more on LINQ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Riza Marhaban</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-612</link>
		<dc:creator>Riza Marhaban</dc:creator>
		<pubDate>Mon, 05 Oct 2009 12:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-612</guid>
		<description>Hi Igor,

This is cool. I never thought Linq was so rich with enumarable manipulation. I was so &#039;stick&#039; to C++ pointers model and C# foreach..loop. Now I need to change my paradigm for arrays using Linq. Nice article.</description>
		<content:encoded><![CDATA[<p>Hi Igor,</p>
<p>This is cool. I never thought Linq was so rich with enumarable manipulation. I was so &#8216;stick&#8217; to C++ pointers model and C# foreach..loop. Now I need to change my paradigm for arrays using Linq. Nice article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor Ostrovsky</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-538</link>
		<dc:creator>Igor Ostrovsky</dc:creator>
		<pubDate>Sun, 05 Jul 2009 21:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-538</guid>
		<description>Hi Polo H,

What exactly isn&#039;t working for you? Do you get exceptions? Or compile errors? Or wrong results?

It is hard to tell from the complex query what your problem may be.</description>
		<content:encoded><![CDATA[<p>Hi Polo H,</p>
<p>What exactly isn&#8217;t working for you? Do you get exceptions? Or compile errors? Or wrong results?</p>
<p>It is hard to tell from the complex query what your problem may be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Polo H</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-537</link>
		<dc:creator>Polo H</dc:creator>
		<pubDate>Tue, 30 Jun 2009 18:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-537</guid>
		<description>Can you help me understand or point me in the right direction to solve my issue. I&#039;m trying to subgroup a Datatable(all I am given) using LINQ. I am trying to go several layers deep(5).

I have tried several things but everything falls apart after three levels. I&#039;m sure I just don&#039;t understand it that well yet.  I have tried:

        var query = from nRow in newDT2.AsEnumerable()
                    group nRow by nRow.Field(&quot;agency_group&quot;) into agency_group
                    select new 
                    {
                        ag = agency_group.AsEnumerable(),
                        agK = agency_group.Key,
                        agency_names =
                        from agency_names in agency_group
                        group agency_names by agency_names.Field(&quot;agency_name&quot;) into agency_names_group
                        select new
                        {
                            an = agency_names_group.AsEnumerable(),
                            anK = agency_names_group.Key,
                            div_depts = 
                            from div_depts in agency_names_group
                            group div_depts by div_depts.Field(&quot;div_dept&quot;) into div_depts_group
                            select new
                            {
                                dd = div_depts_group.AsEnumerable(),
                                ddK = div_depts_group.Key,
                                unit_sections = 
                                from unit_section in div_depts_group
                                group unit_section by unit_section.Field(&quot;unit_section&quot;) into unit_section_groups
                                select new
                                {
                                    us = unit_section_groups.AsEnumerable(),
                                    usK = unit_section_groups.Key,
                                    group_unit_req =
                                    from gur in unit_section_groups
                                    group gur by gur.Field(&quot;group_unit_requirement&quot;)
                                }
                            }
                        }
                    };

and 


        var query = from nRow in newDT.AsEnumerable()
                    group nRow by nRow.Field(&quot;agency_group&quot;) into agency_group
                    from agency_name in
                        (from nRow in agency_group
                         group nRow by nRow.Field(&quot;agency_name&quot;) into agency_name_group
                         from division_name in
                             (from nRow in agency_name_group
                              group nRow by nRow.Field(&quot;div_dept&quot;))
                         group division_name by agency_name_group)
                    group agency_name by agency_group;

But something just isn&#039;t working for me. I&#039;ve looked all over and can&#039;t find anything that goes that deep. Any help you can provide is greatly appreciate.

Have a good day.</description>
		<content:encoded><![CDATA[<p>Can you help me understand or point me in the right direction to solve my issue. I&#8217;m trying to subgroup a Datatable(all I am given) using LINQ. I am trying to go several layers deep(5).</p>
<p>I have tried several things but everything falls apart after three levels. I&#8217;m sure I just don&#8217;t understand it that well yet.  I have tried:</p>
<p>        var query = from nRow in newDT2.AsEnumerable()<br />
                    group nRow by nRow.Field(&#8220;agency_group&#8221;) into agency_group<br />
                    select new<br />
                    {<br />
                        ag = agency_group.AsEnumerable(),<br />
                        agK = agency_group.Key,<br />
                        agency_names =<br />
                        from agency_names in agency_group<br />
                        group agency_names by agency_names.Field(&#8220;agency_name&#8221;) into agency_names_group<br />
                        select new<br />
                        {<br />
                            an = agency_names_group.AsEnumerable(),<br />
                            anK = agency_names_group.Key,<br />
                            div_depts =<br />
                            from div_depts in agency_names_group<br />
                            group div_depts by div_depts.Field(&#8220;div_dept&#8221;) into div_depts_group<br />
                            select new<br />
                            {<br />
                                dd = div_depts_group.AsEnumerable(),<br />
                                ddK = div_depts_group.Key,<br />
                                unit_sections =<br />
                                from unit_section in div_depts_group<br />
                                group unit_section by unit_section.Field(&#8220;unit_section&#8221;) into unit_section_groups<br />
                                select new<br />
                                {<br />
                                    us = unit_section_groups.AsEnumerable(),<br />
                                    usK = unit_section_groups.Key,<br />
                                    group_unit_req =<br />
                                    from gur in unit_section_groups<br />
                                    group gur by gur.Field(&#8220;group_unit_requirement&#8221;)<br />
                                }<br />
                            }<br />
                        }<br />
                    };</p>
<p>and </p>
<p>        var query = from nRow in newDT.AsEnumerable()<br />
                    group nRow by nRow.Field(&#8220;agency_group&#8221;) into agency_group<br />
                    from agency_name in<br />
                        (from nRow in agency_group<br />
                         group nRow by nRow.Field(&#8220;agency_name&#8221;) into agency_name_group<br />
                         from division_name in<br />
                             (from nRow in agency_name_group<br />
                              group nRow by nRow.Field(&#8220;div_dept&#8221;))<br />
                         group division_name by agency_name_group)<br />
                    group agency_name by agency_group;</p>
<p>But something just isn&#8217;t working for me. I&#8217;ve looked all over and can&#8217;t find anything that goes that deep. Any help you can provide is greatly appreciate.</p>
<p>Have a good day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LINQ Tips and Tricks &#171; NetInverse Developers Blog</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-531</link>
		<dc:creator>LINQ Tips and Tricks &#171; NetInverse Developers Blog</dc:creator>
		<pubDate>Fri, 19 Jun 2009 07:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-531</guid>
		<description>[...] Initialize an array [...]</description>
		<content:encoded><![CDATA[<p>[...] Initialize an array [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LINQ &#171; Steveluo&#8217;s Blog</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-513</link>
		<dc:creator>LINQ &#171; Steveluo&#8217;s Blog</dc:creator>
		<pubDate>Sat, 11 Apr 2009 18:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-513</guid>
		<description>[...] 7 tricks to simplify your programs with LINQ &#124; Igor Ostrovsky Blogging Possibly related posts: (automatically generated)How to use Aggregate functions with LINQ to [...]</description>
		<content:encoded><![CDATA[<p>[...] 7 tricks to simplify your programs with LINQ | Igor Ostrovsky Blogging Possibly related posts: (automatically generated)How to use Aggregate functions with LINQ to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Weekly Web Nuggets #13 : Code Monkey Labs</title>
		<link>http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/comment-page-1/#comment-457</link>
		<dc:creator>Weekly Web Nuggets #13 : Code Monkey Labs</dc:creator>
		<pubDate>Mon, 23 Feb 2009 03:49:52 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/#comment-457</guid>
		<description>[...] 7 Tricks to Simplify Your Programs with LINQ: Think LINQ is just for databases? If so, you are quite wrong! Igor Ostrovsky has put together an excellent post outlining simple, yet effective, ways to use LINQ to simplify your code. A great primer for the latest and greatest from Redmond! [...]</description>
		<content:encoded><![CDATA[<p>[...] 7 Tricks to Simplify Your Programs with LINQ: Think LINQ is just for databases? If so, you are quite wrong! Igor Ostrovsky has put together an excellent post outlining simple, yet effective, ways to use LINQ to simplify your code. A great primer for the latest and greatest from Redmond! [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
