<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>C# 3.0 for Beginners</title>
        <link>http://geekswithblogs.net/elroydsilva/category/9017.aspx</link>
        <description>C# 3.0 for Beginners</description>
        <language>en-US</language>
        <copyright>Elroy Dsilva</copyright>
        <managingEditor>elroydsilva@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>C# 3.0 for Beginners - Extension Methods - Part 2</title>
            <link>http://geekswithblogs.net/elroydsilva/archive/2009/01/05/c-3.0-for-beginners---extension-methods---part-2.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128372"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128372" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elroydsilva/aggbug/128372.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Elroy Dsilva</dc:creator>
            <guid>http://geekswithblogs.net/elroydsilva/archive/2009/01/05/c-3.0-for-beginners---extension-methods---part-2.aspx</guid>
            <pubDate>Tue, 06 Jan 2009 11:32:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elroydsilva/comments/128372.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elroydsilva/archive/2009/01/05/c-3.0-for-beginners---extension-methods---part-2.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/elroydsilva/comments/commentRss/128372.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elroydsilva/services/trackbacks/128372.aspx</trackback:ping>
        </item>
        <item>
            <title>C# 3.0 for Beginners - Extension Methods - Part 1</title>
            <link>http://geekswithblogs.net/elroydsilva/archive/2008/11/06/c-3.0-for-beginners---extension-methods.aspx</link>
            <description>&lt;font size="2"&gt;           All C# code is eventually executed by the .NET CLR. This requires the C# compiler to transform the LINQ query expressions to a format that is understandable by .NET. LINQ query expressions are transformed into method calls, which are called &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;extension methods&lt;/span&gt;. These methods are slightly different from normal methods. Lets discuss them in more detail:&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font size="2"&gt;Consider the example that we saw in my previous posts. &lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;link href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; GetIExplorer()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;1. Data Source&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;Process[] processes = Process.GetProcesses();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;2. Query Creation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&amp;gt; query =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;              &lt;/span&gt;&lt;span style="COLOR: blue"&gt;from&lt;/span&gt; p &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; processes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;where&lt;/span&gt; p.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;select&lt;/span&gt; p.Id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;3. Query execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; pid &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; query)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;            &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="COLOR: rgb(163,21,21)"&gt;"Process Id : "&lt;/span&gt;+pid);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;font size="2"&gt;The query creation in part two transforms in a series of method calls on the data source '&lt;span style="FONT-WEIGHT: bold"&gt;processes&lt;/span&gt;' as follows.&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;link href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&amp;gt; query =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;            &lt;/span&gt;processes.Where(p =&amp;gt; p.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;                     &lt;/span&gt;.Select(p =&amp;gt; p.Id);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/address&gt;
&lt;br /&gt;
&lt;font size="2"&gt;The &lt;span style="FONT-WEIGHT: bold"&gt;Select &lt;/span&gt;clause, however, it not essential. It may be ignored and you might retrieve a list of processes and not their process Ids. The Select clause here specifies the entity to be selected in detail, in the above example, it was the process id belonging to the selected process.&lt;br /&gt;
&lt;br /&gt;
Now, you might wonder that since the &lt;span style="FONT-WEIGHT: bold"&gt;Where()&lt;/span&gt; method was called on the 'processes' Array, the Array object might have implemented the Where() method. But, that's not quite the case here. The method Where() is called an extension method and is used for extending a type's functionality.&lt;br /&gt;
&lt;br /&gt;
We have also made use of lambda expressions here. We will discuss their significance later in detail, but, for now, you can look at it as if it were a provision to select entities based in certain specified conditions. In the above code the variable 'p' indicates each element in the 'processes' array which is subjected to an expression evaluation &lt;span style="FONT-WEIGHT: bold"&gt;(p.ProcessName.ToLower().Equals("iexplore"))&lt;/span&gt;, and only if the result of the condition evaluation is true, will the item be selected as the result of the query. These are filtering expressions. &lt;br /&gt;
&lt;br /&gt;
In my next post I will describe how to define and use your own extension methods.&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126736"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126736" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elroydsilva/aggbug/126736.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Elroy Dsilva</dc:creator>
            <guid>http://geekswithblogs.net/elroydsilva/archive/2008/11/06/c-3.0-for-beginners---extension-methods.aspx</guid>
            <pubDate>Fri, 07 Nov 2008 06:29:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elroydsilva/comments/126736.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elroydsilva/archive/2008/11/06/c-3.0-for-beginners---extension-methods.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/elroydsilva/comments/commentRss/126736.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elroydsilva/services/trackbacks/126736.aspx</trackback:ping>
        </item>
        <item>
            <title>C# 3.0 for Beginners - Query Execution in LINQ</title>
            <link>http://geekswithblogs.net/elroydsilva/archive/2008/11/04/query-execution-in-linq.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;       The execution of queries written is different from what a new LINQ user would perceive it to be. The query isn’t evaluated and the result is not stored in the query variable until the foreach iteration (where the values are actually required) or a manual iteration using the underlying GetEnumerator and MoveNext methods. The query variable only stores the query commands. This is concept is referred to as &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;deferred execution&lt;/span&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;address&gt;
&lt;link href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;/address&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; GetIExplorer()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;   &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;1. Data Source&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;Process&lt;/span&gt;[] processes = &lt;span style="COLOR: rgb(43,145,175)"&gt;Process&lt;/span&gt;.GetProcesses();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;2. Query Creation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&amp;gt; query =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;     &lt;/span&gt;from&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; p &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; processes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 1in; TEXT-INDENT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;where&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; p.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 1in; TEXT-INDENT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;select&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; p.Id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;3. Query execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: teal; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;//&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: rgb(51,153,102); FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt; &lt;/span&gt;This is the part where the query is evaluated&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: teal; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;//&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: rgb(51,153,102); FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt; &lt;/span&gt;and result is stored in the query variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; pid &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; query)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="COLOR: rgb(163,21,21)"&gt;"Process Id : "&lt;/span&gt;+pid);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;}&lt;/span&gt;&lt;/address&gt;
&lt;p class="MsoNormal" style="FONT-FAMILY: Arial"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt; &lt;/p&gt;
&lt;link style="FONT-FAMILY: Arial" href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;&lt;font size="2"&gt;As the query variable doesn’t store the results, you can execute it as many times as you like. If a data source is updated at regular intervals, you could retrieve &lt;span style="FONT-WEIGHT: bold"&gt;the latest results&lt;/span&gt; every time you iterate over the query variable.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;img height="139" alt="Deferred execution" width="604" src="/images/geekswithblogs_net/elroydsilva/8932/o_Deferred execution.JPG" /&gt;&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The figure shown above shows information about the query variable ‘&lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;query&lt;/span&gt;’. The &lt;span style="FONT-WEIGHT: bold"&gt;Results View&lt;/span&gt; section shows the results of query execution and it also informs the user that “&lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;Expanding the Results View will enumerate the IEnumerable&lt;/span&gt;” i.e. perform the query execution for debugging.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;font size="3"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Forcing immediate execution of queries&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;
    Immediate execution of queries is forced for queries that perform aggregation functions over the data retrieved from query evaluation. These functions include &lt;span style="FONT-WEIGHT: bold"&gt;Count&lt;/span&gt;, &lt;span style="FONT-WEIGHT: bold"&gt;Max&lt;/span&gt;, &lt;span style="FONT-WEIGHT: bold"&gt;Min&lt;/span&gt;, &lt;span style="FONT-WEIGHT: bold"&gt;Average &lt;/span&gt;etc. These queries execute without an explicit foreach statement because the query itself would use a foreach statement to calculate the result. &lt;br /&gt;
&lt;br /&gt;
The following query returns the number of processes identified as “IExplore.exe”.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;link href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;//&lt;span&gt;  &lt;/span&gt;Calculate the number of "iexplore" processes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;int&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; numberOfProcesses = query.Count();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;font size="2"&gt;Execution results can be cached (if need be) for temporary processing using the ToList() and ToArray() methods as shown below:&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;//&lt;span&gt;  &lt;/span&gt;Caching results using ToList() and ToArray() methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: rgb(43,145,175); FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;List&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&amp;gt; queryResult = &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;(&lt;span style="COLOR: blue"&gt;from&lt;/span&gt; p &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; processes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 1in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;where&lt;/span&gt; p.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 1in"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt; &lt;/span&gt;select&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; p.Id).ToList();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: rgb(43,145,175); FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;Array&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; inferredQueryResult = &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;(&lt;span style="COLOR: blue"&gt;from&lt;/span&gt; p &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; processes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;where&lt;/span&gt; p.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt; &lt;/span&gt;select&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; p.Id).ToArray();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;p class="MsoNormal"&gt;&lt;font size="2"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126603"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126603" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elroydsilva/aggbug/126603.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Elroy Dsilva</dc:creator>
            <guid>http://geekswithblogs.net/elroydsilva/archive/2008/11/04/query-execution-in-linq.aspx</guid>
            <pubDate>Wed, 05 Nov 2008 08:48:42 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elroydsilva/comments/126603.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elroydsilva/archive/2008/11/04/query-execution-in-linq.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/elroydsilva/comments/commentRss/126603.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elroydsilva/services/trackbacks/126603.aspx</trackback:ping>
        </item>
        <item>
            <title>C# 3.0 for Beginners - Learning LINQ - An Overview</title>
            <link>http://geekswithblogs.net/elroydsilva/archive/2008/11/03/learning-linq---an-overview.aspx</link>
            <description>&lt;link href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Georgia;
	panose-1:2 4 5 2 5 4 5 2 3 3;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:951325141;
	mso-list-type:hybrid;
	mso-list-template-ids:-1102166076 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
	{mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p class="MsoNormal" style="TEXT-INDENT: 0.5in; TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I’m probably quite late to provide an overview on LINQ, which is by now a lot more popular than the time when I actually had started hearing about it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-INDENT: 0.5in; TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;Well, this is expected to be a series of posts that would help other rookies like me who haven’t yet started learning LINQ yet. So, lets get started. To begin with I’m providing here an overview of LINQ (Language Integrated Query).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-INDENT: 0.5in; TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;LINQ was introduced by Microsoft with the objective to reduce the complexity of accessing and integrating information. With the LINQ project, Microsoft has added query facilities to the .Net Framework that apply to all sources of information, not just relational or XML data. Everyday programmers write code that accesses a data source using looping and/or conditional constructs etc. The same constructs can be written using query expressions that are far lesser in code size. LINQ makes it possible to write easily readable and elegant code. The examples that follow will imply how easily understandable LINQ code can be. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-INDENT: 0.5in; TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;LINQ defines a set of standard query operators that you can use for traversal, filter and projection operations. These standard operators can be applied to any &lt;strong&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/strong&gt; based information source. The set of standard query operators can be augmented with new domain-specific operators that are more suitable for the target domain or technology. This extensibility in the query architecture is used in the LINQ project itself to provide implementations that work over both XML (LINQ to XML) and SQL (LINQ to SQL) data. Lets write some code to understand the query operators in more detail:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;link href="file:///C:%5CDOCUME%7E1%5CElroy%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 
  Normal
  0
  
  
  false
  false
  false
  
   
   
   
   
   
  
  MicrosoftInternetExplorer4
 
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Font Definitions */
 @font-face
	{
	panose-1:2 4 5 2 5 4 5 2 3 3;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;"Times New Roman";
	mso-fareast-"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-style-parent:"";
	font-size:10.0pt;"Times New Roman";}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;link href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Georgia;
	panose-1:2 4 5 2 5 4 5 2 3 3;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; System.Linq;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; System.Diagnostics;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Georgia"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;///&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;///&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; Using standard query operators.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;///&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; GetIExplorer()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;1. Data Source&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;Process&lt;/span&gt;[] processes = &lt;span style="COLOR: rgb(43,145,175)"&gt;Process&lt;/span&gt;.GetProcesses();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;2. Query Creation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&amp;gt; query = &lt;span style="COLOR: blue"&gt;from&lt;/span&gt; p &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; processes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal" style="MARGIN-LEFT: 2in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;where&lt;/span&gt; p.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;                             &lt;/span&gt;&lt;span style="COLOR: blue"&gt;select&lt;/span&gt; p.Id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: green"&gt;//&lt;span&gt;  &lt;/span&gt;3. Query execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; pid &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; query)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="COLOR: rgb(163,21,21)"&gt;"Process Id : "&lt;/span&gt;+pid);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;All LINQ query operations consist of three distinct operations:&lt;br /&gt;
&lt;br /&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;ol style="MARGIN-TOP: 0in" type="1"&gt;
    &lt;li class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Identify the data source&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/li&gt;
    &lt;li class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Query creation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/li&gt;
    &lt;li class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Query execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Calling the method would show you the currently running Internet Explorer processes (their process ids). The heart of the method lies in the following statement of our program.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt; &lt;/p&gt;
&lt;link href="file:///C:\DOCUME~1\Elroy\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: rgb(43,145,175); FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;IEnumerable&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&amp;gt; query = &lt;span style="COLOR: blue"&gt;from&lt;/span&gt; p &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; processes&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;                         where&lt;/span&gt; p.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;                         &lt;/span&gt;&lt;span style="COLOR: blue"&gt;select&lt;/span&gt; p.Id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The expression on the right hand side of this statement is called the &lt;strong&gt;query expression&lt;/strong&gt;. The output of this expression is held in the local variable ‘&lt;strong&gt;query’&lt;/strong&gt;. The query expression operates on one or more information sources by applying the query operators from the standard or domian specific set of query operators. We have used standard query operators here namely &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;where&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; and &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;select&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;The &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;from&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; clause select the list of processes which becomes the input for the &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;where&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; operator which filters the list and selects only those elements that satisfy the condition specified with the &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;where&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; operator. The selected elements are then processed by the &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;select&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; operator that determines any specific information selection for each element.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;The above statement can also be written using explicit syntax as shown below:&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt; &lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style type="text/css"&gt;&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; COLOR: rgb(43,145,175); FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;IEnumerable&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&amp;gt; query = &lt;span style="COLOR: rgb(43,145,175)"&gt;Process&lt;/span&gt;.GetProcesses()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;               &lt;/span&gt;.Where(s =&amp;gt; s.ProcessName.ToLower().Equals(&lt;span style="COLOR: rgb(163,21,21)"&gt;"iexplore"&lt;/span&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;address class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span&gt;               &lt;/span&gt;.Select(s =&amp;gt; s.Id);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/address&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: &amp;quot;Courier New&amp;quot;"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This form of query is called a method-based query and the arguments to the query operators are called &lt;strong&gt;lambda expressions&lt;/strong&gt;. They allow query operators to be defined individually as methods and are connected using the dot notation. I will deal with lambda expressions in my following posts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="TEXT-ALIGN: justify"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126575"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126575" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elroydsilva/aggbug/126575.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Elroy Dsilva</dc:creator>
            <guid>http://geekswithblogs.net/elroydsilva/archive/2008/11/03/learning-linq---an-overview.aspx</guid>
            <pubDate>Tue, 04 Nov 2008 10:25:45 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elroydsilva/comments/126575.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elroydsilva/archive/2008/11/03/learning-linq---an-overview.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/elroydsilva/comments/commentRss/126575.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elroydsilva/services/trackbacks/126575.aspx</trackback:ping>
        </item>
    </channel>
</rss>