<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Fransiscus Setiawan &#187; .NET</title>
	<atom:link href="http://fransiscuss.com/category/dotnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://fransiscuss.com</link>
	<description>My notepad of knowledge and my passion in development</description>
	<lastBuildDate>Tue, 22 May 2012 05:59:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='fransiscuss.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Fransiscus Setiawan &#187; .NET</title>
		<link>http://fransiscuss.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://fransiscuss.com/osd.xml" title="Fransiscus Setiawan" />
	<atom:link rel='hub' href='http://fransiscuss.com/?pushpress=hub'/>
		<item>
		<title>Yield keyword in .NET</title>
		<link>http://fransiscuss.com/2012/05/20/yield-keyword-in-net/</link>
		<comments>http://fransiscuss.com/2012/05/20/yield-keyword-in-net/#comments</comments>
		<pubDate>Sun, 20 May 2012 23:35:15 +0000</pubDate>
		<dc:creator>fransiscuss</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://fransiscuss.com/?p=396</guid>
		<description><![CDATA[I believe some of you already know about this but for me I never used it. Yield keyword has been existed since .NET 2.0 so I decided to look up of what it does and try to understand it Based on MSDN Yield is used in an iterator block to provide a value to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fransiscuss.com&#038;blog=26182965&#038;post=396&#038;subd=fransiscuss&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I believe some of you already know about this but for me I never used it. Yield keyword has been existed since .NET 2.0 so I decided to look up of what it does and try to understand it</p>
<p>Based on <a href="http://msdn.microsoft.com/en-us/library/9k7k7cf0%28v=vs.80%29.aspx" target="_blank">MSDN </a></p>
<p>Yield is used in an iterator block to provide a value to the enumerator object or to signal the end of iteration, it takes one of the following form</p>
<p>Based on my understanding</p>
<p>Yield is a concatenation for a collection, or in SQL we normally use UNION</p>
<p>Yield break; is used to exit from the concatenation (remember it is not used to skip !)</p>
<p>One practical sample that I can think of is to get the enumerable of exception from inner exception (e.g stack trace)</p>
<p><strong>sample code</strong></p>
<div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt;">
<div style="background:#000080;color:#fff;font-family:Verdana, Tahoma, Arial, sans-serif;font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:#ddd;max-height:300px;overflow:auto;">
<ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;" start="8">
<li><span style="color:#0000ff;">class</span> <span style="color:#2b91af;">Program</span></li>
<li style="background:#f3f3f3;">    {</li>
<li>        <span style="color:#808080;">///</span><span style="color:#808080;">&lt;summary&gt;</span></li>
<li style="background:#f3f3f3;">        <span style="color:#808080;">///</span><span style="color:#008000;"> simple function to return IEnumerable of integer</span></li>
<li>        <span style="color:#808080;">///</span><span style="color:#808080;">&lt;/summary&gt;</span></li>
<li style="background:#f3f3f3;">        <span style="color:#808080;">///</span><span style="color:#808080;">&lt;returns&gt;&lt;/returns&gt;</span></li>
<li>        <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">static</span> <span style="color:#2b91af;">IEnumerable</span>&lt;<span style="color:#0000ff;">int</span>&gt; GetIntegers()</li>
<li style="background:#f3f3f3;">        {</li>
<li>            <span style="color:#0000ff;">for</span> (<span style="color:#0000ff;">int</span> i = 0; i &lt;= 10; i++)</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">yield</span> <span style="color:#0000ff;">return</span> i;</li>
<li>        }</li>
<li style="background:#f3f3f3;"></li>
<li>        <span style="color:#808080;">///</span><span style="color:#808080;">&lt;summary&gt;</span></li>
<li style="background:#f3f3f3;">        <span style="color:#808080;">///</span><span style="color:#008000;"> simple function to return collection of class</span></li>
<li>        <span style="color:#808080;">///</span><span style="color:#808080;">&lt;/summary&gt;</span></li>
<li style="background:#f3f3f3;">        <span style="color:#808080;">///</span><span style="color:#808080;">&lt;returns&gt;&lt;/returns&gt;</span></li>
<li>        <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">static</span> <span style="color:#2b91af;">IEnumerable</span>&lt;<span style="color:#2b91af;">MyClass</span>&gt; GetMyNumbers()</li>
<li style="background:#f3f3f3;">        {</li>
<li>            <span style="color:#0000ff;">for</span> (<span style="color:#0000ff;">int</span> i = 0; i &lt;= 10; i++)</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">if</span> (i &gt; 5)</li>
<li>                    <span style="color:#0000ff;">yield</span> <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">else</span></li>
<li>                    <span style="color:#0000ff;">yield</span> <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">MyClass</span>() { Number = i };</li>
<li style="background:#f3f3f3;">        }</li>
<li></li>
<li style="background:#f3f3f3;">        <span style="color:#0000ff;">internal</span> <span style="color:#0000ff;">class</span> <span style="color:#2b91af;">MyClass</span></li>
<li>        {</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> Number { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</li>
<li>            <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> PrintNumber</li>
<li style="background:#f3f3f3;">            {</li>
<li>                <span style="color:#0000ff;">get</span> {</li>
<li style="background:#f3f3f3;">                    <span style="color:#0000ff;">return</span> <span style="color:#a31515;">&#8220;This is no &#8220;</span> + Number.ToString();</li>
<li>                }</li>
<li style="background:#f3f3f3;">            }</li>
<li>        }</li>
<li style="background:#f3f3f3;"></li>
<li>        <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> Main(<span style="color:#0000ff;">string</span>[] args)</li>
<li style="background:#f3f3f3;">        {</li>
<li>            <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#8220;Simple array of integer&#8221;</span>);</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">foreach</span> (<span style="color:#0000ff;">var</span> number <span style="color:#0000ff;">in</span> GetIntegers())</li>
<li>                <span style="color:#2b91af;">Console</span>.WriteLine(number.ToString());</li>
<li style="background:#f3f3f3;"></li>
<li>            <span style="color:#2b91af;">Console</span>.WriteLine();</li>
<li style="background:#f3f3f3;">            <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#8220;Collection of classes&#8221;</span>);</li>
<li>            <span style="color:#0000ff;">foreach</span> (<span style="color:#0000ff;">var</span> myclass <span style="color:#0000ff;">in</span> GetMyNumbers())</li>
<li style="background:#f3f3f3;">                <span style="color:#2b91af;">Console</span>.WriteLine(myclass.PrintNumber);</li>
<li></li>
<li style="background:#f3f3f3;">            <span style="color:#2b91af;">Console</span>.ReadLine();</li>
<li>        }</li>
<li style="background:#f3f3f3;">    }</li>
</ol>
</div>
</div>
<p><strong>Output</strong></p>
<div>Simple array of an integer<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10Collection of classes<br />
This is no 0<br />
This is no 1<br />
This is no 2<br />
This is no 3<br />
This is no 4<br />
This is no 5</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fransiscuss.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fransiscuss.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fransiscuss.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fransiscuss.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fransiscuss.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fransiscuss.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fransiscuss.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fransiscuss.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fransiscuss.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fransiscuss.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fransiscuss.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fransiscuss.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fransiscuss.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fransiscuss.wordpress.com/396/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fransiscuss.com&#038;blog=26182965&#038;post=396&#038;subd=fransiscuss&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fransiscuss.com/2012/05/20/yield-keyword-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e5c1d49eb30cdc979601f6e85e962a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fransiscuss</media:title>
		</media:content>
	</item>
		<item>
		<title>Remapping svc extension in IIS 7 extension handlers</title>
		<link>http://fransiscuss.com/2011/11/08/remapping-svc-extension-in-iis-7-extension-handlers/</link>
		<comments>http://fransiscuss.com/2011/11/08/remapping-svc-extension-in-iis-7-extension-handlers/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 03:55:45 +0000</pubDate>
		<dc:creator>fransiscuss</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://fransiscuss.com/2011/11/08/remapping-svc-extension-in-iis-7-extension-handlers/</guid>
		<description><![CDATA[If you open your WCF/ svc file in your localhost through browser and it just display blank page then what might happen is you don’t have handler associated with svc extension To verify it, go to your IIS and go to IIS Handler Mappings and try to find an svc extension entry, but if you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fransiscuss.com&#038;blog=26182965&#038;post=316&#038;subd=fransiscuss&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you open your WCF/ svc file in your localhost through browser and it just display blank page then what might happen is you don’t have handler associated with svc extension</p>
<p>To verify it, go to your IIS and go to IIS Handler Mappings and try to find an svc extension entry, but if you couldn’t find extension SVC exists on the list, then you can remap/re-add the svc extension by running</p>
<p><strong>C:\Windows\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation\ServiceModelReg.exe –i</strong></p>
<p>*if you are still using 32 bit then you just need to replace Framework64 with Framework</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fransiscuss.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fransiscuss.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fransiscuss.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fransiscuss.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fransiscuss.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fransiscuss.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fransiscuss.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fransiscuss.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fransiscuss.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fransiscuss.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fransiscuss.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fransiscuss.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fransiscuss.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fransiscuss.wordpress.com/316/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fransiscuss.com&#038;blog=26182965&#038;post=316&#038;subd=fransiscuss&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fransiscuss.com/2011/11/08/remapping-svc-extension-in-iis-7-extension-handlers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e5c1d49eb30cdc979601f6e85e962a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fransiscuss</media:title>
		</media:content>
	</item>
	</channel>
</rss>
