<?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"
	>
<channel>
	<title>Comments on: C# 3.0 Tutorials: Implicitly typed local variables</title>
	<atom:link href="http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables/feed" rel="self" type="application/rss+xml" />
	<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables</link>
	<description>Sharing our knowledge</description>
	<pubDate>Mon, 08 Sep 2008 15:22:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Nik Radford</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-72471</link>
		<dc:creator>Nik Radford</dc:creator>
		<pubDate>Tue, 17 Jun 2008 12:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-72471</guid>
		<description>Here's a question, unfortunately I don't have VS2008 at hand to test it with.

Now this is not great code but I just thought about

Lets say, for the sake of hypothesising 

I have an interface called IMyInterface, I have an object called MyObject that implement IMyInterface.

I have a function that has a return type IMyInterface, but actually returns an instantiated MyObject.

I initialize my var with the return of this function.

for brevity and in pseudo I do this.

var myVar = MyFunction();

does myVar become of type IMyInterface or of type MyObject when I'm dealing with it?

I'm pretty sure visual studio will treat it as IMyInterface, because it'll look up the return type of the function called in order to provide intellisense. But as to the compiler? hmm... I'll have to test that. My Expectation would be IMyInterface, and if it wasn't it'd be bad not to treats as IMyInterface, but it certainly provides food for thought.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a question, unfortunately I don&#8217;t have VS2008 at hand to test it with.</p>
<p>Now this is not great code but I just thought about</p>
<p>Lets say, for the sake of hypothesising </p>
<p>I have an interface called IMyInterface, I have an object called MyObject that implement IMyInterface.</p>
<p>I have a function that has a return type IMyInterface, but actually returns an instantiated MyObject.</p>
<p>I initialize my var with the return of this function.</p>
<p>for brevity and in pseudo I do this.</p>
<p>var myVar = MyFunction();</p>
<p>does myVar become of type IMyInterface or of type MyObject when I&#8217;m dealing with it?</p>
<p>I&#8217;m pretty sure visual studio will treat it as IMyInterface, because it&#8217;ll look up the return type of the function called in order to provide intellisense. But as to the compiler? hmm&#8230; I&#8217;ll have to test that. My Expectation would be IMyInterface, and if it wasn&#8217;t it&#8217;d be bad not to treats as IMyInterface, but it certainly provides food for thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-64700</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Thu, 22 May 2008 08:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-64700</guid>
		<description>Can you show me your LINQ code? Normally, you can check the count of var..  
e.g. 

Option #1.
selectedProduct.resultView.Count 

OR

Option #2.

bool isFound = false;

var selPdt = LINQ;

foreach(var i in selPdt){
  isFound = true;
}

if(isFound){
  //DoSomething
}</description>
		<content:encoded><![CDATA[<p>Can you show me your LINQ code? Normally, you can check the count of var..<br />
e.g. </p>
<p>Option #1.<br />
selectedProduct.resultView.Count </p>
<p>OR</p>
<p>Option #2.</p>
<p>bool isFound = false;</p>
<p>var selPdt = LINQ;</p>
<p>foreach(var i in selPdt){<br />
  isFound = true;<br />
}</p>
<p>if(isFound){<br />
  //DoSomething<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ahtesham</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-64664</link>
		<dc:creator>ahtesham</dc:creator>
		<pubDate>Thu, 22 May 2008 05:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-64664</guid>
		<description>lets say i have store the values from linq store procedure into var 
var selectedProduct= storeProcedure of linq
now i want to see if selectedProduct is null or empty 
i tried with
selectedProduct==null 
selectedProduct.returnValue=null 
selectedProduct.returnValue.tostring()==string.empty
but none worked 
so any suggestion that tell me that that var is empty or null or do not have any value
thanks in advance</description>
		<content:encoded><![CDATA[<p>lets say i have store the values from linq store procedure into var<br />
var selectedProduct= storeProcedure of linq<br />
now i want to see if selectedProduct is null or empty<br />
i tried with<br />
selectedProduct==null<br />
selectedProduct.returnValue=null<br />
selectedProduct.returnValue.tostring()==string.empty<br />
but none worked<br />
so any suggestion that tell me that that var is empty or null or do not have any value<br />
thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C# 3.0 Tutorials: Implicitly typed local variables</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-45504</link>
		<dc:creator>C# 3.0 Tutorials: Implicitly typed local variables</dc:creator>
		<pubDate>Thu, 13 Mar 2008 16:39:11 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-45504</guid>
		<description>[...] Original post by Michael Sync [...]</description>
		<content:encoded><![CDATA[<p>[...] Original post by Michael Sync [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: W&#246;chentliche Rundablage: ASP.NET MVC, ASP.NET, Windows Live, Silverlight 2, LINQ, C# 3.0, CardSpace&#8230; &#124; Code-Inside Blog</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43549</link>
		<dc:creator>W&#246;chentliche Rundablage: ASP.NET MVC, ASP.NET, Windows Live, Silverlight 2, LINQ, C# 3.0, CardSpace&#8230; &#124; Code-Inside Blog</dc:creator>
		<pubDate>Mon, 03 Mar 2008 19:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43549</guid>
		<description>[...] C# 3.0 Tutorials: Implicitly typed local variables [...]</description>
		<content:encoded><![CDATA[<p>[...] C# 3.0 Tutorials: Implicitly typed local variables [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thinzar - သဥၹာ</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43426</link>
		<dc:creator>thinzar - သဥၹာ</dc:creator>
		<pubDate>Mon, 03 Mar 2008 05:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43426</guid>
		<description>Now i'm following this tutorial series. :) Thanks for the great tutorials!! I have worked on C#, like one and a half year ago. Just take over other ppl's project without digging all these basics grounds of C#. What a lazy programmer I hv been! These are tutorials which indeed helpful to me. Waiting for the later episodes...</description>
		<content:encoded><![CDATA[<p>Now i&#8217;m following this tutorial series. <img src='http://michaelsync.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Thanks for the great tutorials!! I have worked on C#, like one and a half year ago. Just take over other ppl&#8217;s project without digging all these basics grounds of C#. What a lazy programmer I hv been! These are tutorials which indeed helpful to me. Waiting for the later episodes&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43203</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Sun, 02 Mar 2008 03:46:05 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43203</guid>
		<description>&lt;blockquote&gt;Sorry, but I don’t understand the meaning.&lt;/blockquote&gt;

thanks for your comment. What I meant by that is that the type of implicitly-typed local variable will be changed based on what you initialize to that variable. For example: var myvar = 1; myvar is not an object or variable. myvar is integer data type since you have initialized the value "1" to that variable.. 

hope you understand about that. feel free to let me know if you are still not clear about that.</description>
		<content:encoded><![CDATA[<blockquote><p>Sorry, but I don’t understand the meaning.</p></blockquote>
<p>thanks for your comment. What I meant by that is that the type of implicitly-typed local variable will be changed based on what you initialize to that variable. For example: var myvar = 1; myvar is not an object or variable. myvar is integer data type since you have initialized the value &#8220;1&#8243; to that variable.. </p>
<p>hope you understand about that. feel free to let me know if you are still not clear about that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zlatko Filipovski</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43159</link>
		<dc:creator>Zlatko Filipovski</dc:creator>
		<pubDate>Sat, 01 Mar 2008 23:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43159</guid>
		<description>"That type of that variable will be changed the actual type based on what you have assigned to that variable"
Sorry, but I don't understand the meaning.
By the way, nice blog.</description>
		<content:encoded><![CDATA[<p>&#8220;That type of that variable will be changed the actual type based on what you have assigned to that variable&#8221;<br />
Sorry, but I don&#8217;t understand the meaning.<br />
By the way, nice blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync &#187; C# 3.0 Tutorials with Visual Studio 2008 for Beginners</title>
		<link>http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43080</link>
		<dc:creator>Michael Sync &#187; C# 3.0 Tutorials with Visual Studio 2008 for Beginners</dc:creator>
		<pubDate>Sat, 01 Mar 2008 15:41:56 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/01/c-30-tutorials-implicitly-typed-local-variables#comment-43080</guid>
		<description>[...] Implicitly typed local variables [...]</description>
		<content:encoded><![CDATA[<p>[...] Implicitly typed local variables [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
