<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" 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:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Discussions by mrjvdveen</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/mrjvdveen/Discussions/RSS"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 - Discussions by mrjvdveen</title>
		<link>http://channel9.msdn.com/Niners/mrjvdveen/Discussions</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Niners/mrjvdveen/Discussions</link>
	<language>en</language>
	<pubDate>Thu, 23 May 2013 00:35:26 GMT</pubDate>
	<lastBuildDate>Thu, 23 May 2013 00:35:26 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>0</c9:totalResults>
	<c9:pageCount>0</c9:pageCount>
	<c9:pageSize>0</c9:pageSize>
	<item>
		<title>Coffeehouse - C# Extension Properties?</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">exoteric said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">frindly1000 said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Still, using a pair of empty ellipses, you can still achieve the same effect, i.e. (for gets, not for sets)</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">20.Minutes().Ago()</pre>
<p></p>
<p>&nbsp;</p>
<p>I <a href="http://www.scala-lang.org/node/118">believe </a>in Scala you can use any method using infix notation so you might be able to express something like</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: text">20 minutes ago</pre>
<p></p>
<p>&nbsp;</p>
<p>I'm experimenting with using extension methods to achieve null-safe &quot;object-oriented&quot; expressions</p>
<p>&nbsp;</p>
<p></p>
<pre class="brush: csharp">int? v = element.Value().Eval&lt;int&gt;();</pre>
<p></p>
<p>&nbsp;</p>
<p>Value(), as an extension method over XElement, and Eval as an extension method over object, are both null-safe. If element is null, then the whole expression evaluates to null; if element.Value() is null, then the whole expression evaluates to null; if element.Value().Eval&lt;int&gt;()
 is not possible (format error or unsupported conversion), then the whole expression evaluates to null.&nbsp;</p>
<p>&nbsp;</p>
<p>This property, that one can model null-safety with extension methods is absolutely adorable.</p>
<p>&nbsp;</p>
<p>I think the C# field/method/property system is a bit non-uniform now, but it's still very useable and powerful.</p>
</div></blockquote>
<p>True, but you can't use that in something like databinding (in WPF or Silverlight at least). Sometimes you just need a property.</p>
<p>Having extension properties would be extremely powerful in a scenario where you use something like LinqToSql in a service, use partial classes there to make properties available in the DataContract and then use some extension properties to format some properties
 for databinding.</p>
<p>I know I could do the latter with a valueconverter but I find that more troublesome then it needs to be.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/257556-C-Extension-Properties/b1c02eb0f6ac4c1ba6839deb0015c3c9#b1c02eb0f6ac4c1ba6839deb0015c3c9</link>
		<pubDate>Wed, 23 Sep 2009 07:44:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/257556-C-Extension-Properties/b1c02eb0f6ac4c1ba6839deb0015c3c9#b1c02eb0f6ac4c1ba6839deb0015c3c9</guid>
		<dc:creator>Jonathan van de Veen</dc:creator>
		<slash:comments>42</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/mrjvdveen/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>