<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chetan&#039;s web scribblings! &#187; C#</title>
	<atom:link href="http://blog.newtonicaonline.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.newtonicaonline.com</link>
	<description>Enjoy!</description>
	<lastBuildDate>Mon, 26 Sep 2011 10:07:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>New features of C# 3.0</title>
		<link>http://blog.newtonicaonline.com/new-features-of-c-3-0/</link>
		<comments>http://blog.newtonicaonline.com/new-features-of-c-3-0/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 09:37:10 +0000</pubDate>
		<dc:creator>Chetan</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://blog.newtonicaonline.com/?p=94</guid>
		<description><![CDATA[Look at simple source code to learn few of new features of C# 3.0. 12345678910111213141516171819202122232425262728293031323334353637public class Book &#123; &#160; &#160; //Auto implemented properties &#160; &#160; public string Name &#123; get; set; &#125; &#160; &#160; public int ID &#123; get; set; &#125; &#125; public class AllLINQ &#123; &#160; &#160; public static void ShowAll&#40;&#41; &#160; &#160; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>Look at simple source code to learn few of new features of C# 3.0.</p>
<div class="codecolorer-container csharp blackboard codecolorer-noborder" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:460px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Book<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">//Auto implemented properties</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">int</span> ID <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span><br />
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> AllLINQ<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> ShowAll<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">//Collection Initializer and Implicitly Typed Local Variables using 'var'. </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">//Note how List&lt;Book&gt; is created and filled in one line of source code.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; var Books <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> List<span style="color: #008000;">&lt;</span>Book<span style="color: #008000;">&gt;</span> <span style="color: #008000;">&#123;</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Book <span style="color: #008000;">&#123;</span> Name <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Learn C#&quot;</span>, ID <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span> <span style="color: #008000;">&#125;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Book <span style="color: #008000;">&#123;</span> Name <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Learn .Net&quot;</span>, ID <span style="color: #008000;">=</span> <span style="color: #FF0000;">2</span> <span style="color: #008000;">&#125;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Book <span style="color: #008000;">&#123;</span> Name <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Power Electronics&quot;</span>, ID <span style="color: #008000;">=</span> <span style="color: #FF0000;">3</span> <span style="color: #008000;">&#125;</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">//LINQ</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; var BooksQuery <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">from</span> book <span style="color: #0600FF; font-weight: bold;">in</span> Books<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">//calling extesion method</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">where</span> book<span style="color: #008000;">.</span><span style="color: #0000FF;">IsLearningSeries</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">//Anonymous Type</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">select</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #008000;">&#123;</span> FetchedBook<span style="color: #008000;">=</span>book, TimeStamp<span style="color: #008000;">=</span><span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DateTime</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Now</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var SearchedResult <span style="color: #0600FF; font-weight: bold;">in</span> BooksQuery<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot; Searched at : &quot;</span> <span style="color: #008000;">+</span> SearchedResult<span style="color: #008000;">.</span><span style="color: #0000FF;">TimeStamp</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot; Book Name : &quot;</span> <span style="color: #008000;">+</span> SearchedResult<span style="color: #008000;">.</span><span style="color: #0000FF;">FetchedBook</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Book ID = &quot;</span> <span style="color: #008000;">+</span> SearchedResult<span style="color: #008000;">.</span><span style="color: #0000FF;">FetchedBook</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ID</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span><br />
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> Extensions<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">//Extension Method for Book class. Note 'this' against parameter.</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsLearningSeries<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> Book b<span style="color: #008000;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> b<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Contains</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Learn&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<div class='sociable'><div><span class='sociable-tagline'></span></div><ul><li><a rel="nofollow" target="_blank"  href="http://blog.newtonicaonline.com/feed/" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a></li><li><a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a></li><li><a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a></li><li><a rel="nofollow" target="_blank"  href="http://twitter.com/home?status=New%20features%20of%20C%23%203.0%20-%20http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a></li><li><a rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F&amp;title=New%20features%20of%20C%23%203.0&amp;notes=Look%20at%20simple%20source%20code%20to%20learn%20few%20of%20new%20features%20of%20C%23%203.0.%0D%0A%0D%0A%5Bcc%20lang%3D%22c%23%22%20escaped%3D%22true%22%20width%3D%22100%25%22%20noborder%3D%221%22%20theme%3D%22blackboard%22%20height%3D%22460%22%20line_numbers%3D%22on%22%5D%0D%0Apublic%20class%20Book%0D%0A%7B%0D%0A%09%2F%2FAuto%20implemented%20properties%0D%0A%09public%20string%20Name" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a></li><li><a rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F&amp;t=New%20features%20of%20C%23%203.0" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a></li><li><a rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F&amp;title=New%20features%20of%20C%23%203.0&amp;source=Chetan%26%23039%3Bs+web+scribblings%21+Enjoy%21&amp;summary=Look%20at%20simple%20source%20code%20to%20learn%20few%20of%20new%20features%20of%20C%23%203.0.%0D%0A%0D%0A%5Bcc%20lang%3D%22c%23%22%20escaped%3D%22true%22%20width%3D%22100%25%22%20noborder%3D%221%22%20theme%3D%22blackboard%22%20height%3D%22460%22%20line_numbers%3D%22on%22%5D%0D%0Apublic%20class%20Book%0D%0A%7B%0D%0A%09%2F%2FAuto%20implemented%20properties%0D%0A%09public%20string%20Name" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a></li><li><a rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F&amp;title=New%20features%20of%20C%23%203.0&amp;annotation=Look%20at%20simple%20source%20code%20to%20learn%20few%20of%20new%20features%20of%20C%23%203.0.%0D%0A%0D%0A%5Bcc%20lang%3D%22c%23%22%20escaped%3D%22true%22%20width%3D%22100%25%22%20noborder%3D%221%22%20theme%3D%22blackboard%22%20height%3D%22460%22%20line_numbers%3D%22on%22%5D%0D%0Apublic%20class%20Book%0D%0A%7B%0D%0A%09%2F%2FAuto%20implemented%20properties%0D%0A%09public%20string%20Name" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a></li><li><a rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F&amp;title=New%20features%20of%20C%23%203.0&amp;bodytext=Look%20at%20simple%20source%20code%20to%20learn%20few%20of%20new%20features%20of%20C%23%203.0.%0D%0A%0D%0A%5Bcc%20lang%3D%22c%23%22%20escaped%3D%22true%22%20width%3D%22100%25%22%20noborder%3D%221%22%20theme%3D%22blackboard%22%20height%3D%22460%22%20line_numbers%3D%22on%22%5D%0D%0Apublic%20class%20Book%0D%0A%7B%0D%0A%09%2F%2FAuto%20implemented%20properties%0D%0A%09public%20string%20Name" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a></li><li><a rel="nofollow" target="_blank" title="Add to favorites" href="#" onclick="AddToFavorites(); return false;"><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/addtofavorites.png" class="sociable-img sociable-hovers" title="Add to favorites" alt="Add to favorites" /></a></li><li><a rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.newtonicaonline.com%2Fnew-features-of-c-3-0%2F&amp;title=New%20features%20of%20C%23%203.0" ><img src="http://blog.newtonicaonline.com/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.newtonicaonline.com/new-features-of-c-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

