<?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>Codelab Blog &#187; Anonymous Function</title>
	<atom:link href="http://blog.codelab.co.nz/tag/anonymous-function/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codelab.co.nz</link>
	<description>Technical Articles and News from Codelab Ltd</description>
	<lastBuildDate>Tue, 17 Jan 2012 13:10:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Action(T) Generic Delegate</title>
		<link>http://blog.codelab.co.nz/2009/01/19/actiont-generic-delegate/</link>
		<comments>http://blog.codelab.co.nz/2009/01/19/actiont-generic-delegate/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 03:32:53 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Anonymous Function]]></category>
		<category><![CDATA[Delegate]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=61</guid>
		<description><![CDATA[Very useful delegate to create anonymous functions…why? This is especially useful when you have repeated code within a function. This particular example gets a list of tables from a database based on a key that is consumed by the id parameter. The Action(T) delegate can have zero to several different parameter types. Action getTables(String id) [...]]]></description>
			<content:encoded><![CDATA[<p>Very useful delegate to create anonymous functions…why? This is especially useful when you have repeated code within a function.</p>
<p>This particular example gets a list of tables from a database based on a key that is consumed by the id parameter.</p>
<p>The Action(T) delegate can have zero to several different parameter types.</p>
<blockquote><p>Action getTables(String id) = delegate() {<br />
List&lt;Tables&gt; lTables = new Select().From&lt;Tables&gt;.Where&lt;Tables.RelatedId&gt;().IsEqualTo(id).ExecuteTypedList&lt;Tables&gt;();<br />
});</p></blockquote>
<p>Call the function within the function you declared the anonymous function:</p>
<blockquote><p>getTables(“1”);</p></blockquote>
<p>That simple…Awesome!</p>
<p><em><strong>References:</strong></em></p>
<p><a href="http://msdn.microsoft.com/en-us/library/018hxwa8.aspx">http://msdn.microsoft.com/en-us/library/018hxwa8.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2009/01/19/actiont-generic-delegate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

