<?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>TheUndeadable entwickelt &#187; LINQ</title>
	<atom:link href="http://blog.depon.net/index.php/tag/linq/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.depon.net</link>
	<description>Ein Ausschnitt aus dem Leben</description>
	<lastBuildDate>Fri, 03 Feb 2012 18:11:00 +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>Manchmal darf es eben LINQ sein</title>
		<link>http://blog.depon.net/index.php/2009/08/22/manchmal-darf-es-eben-linq-sein/</link>
		<comments>http://blog.depon.net/index.php/2009/08/22/manchmal-darf-es-eben-linq-sein/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 23:19:57 +0000</pubDate>
		<dc:creator>TheUndeadable</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Jungfrauenspiel]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://blog.depon.net/index.php/2009/08/22/manchmal-darf-es-eben-linq-sein/</guid>
		<description><![CDATA[/// &#60;summary&#62; /// Gets the dashboarditems of the player /// &#60;/summary&#62; /// &#60;param name=&#34;amount&#34;&#62;Number of items to be returned&#60;/param&#62; /// &#60;returns&#62;Enumeration of Dashboarditems&#60;/returns&#62; public IEnumerable&#60;DashboardItem&#62; GetDashboardItems(int amount) { &#160;&#160;&#160; var messageSystem = this.LogicSession.GetLogicHandler&#60;IMessageSystemLogic&#62;(); &#160;&#160;&#160; var playerActionLogic = this.LogicSession.GetLogicHandler&#60;IPlayerActionLogic&#62;(); &#160;&#160;&#160; var languageHandler = this.LogicSession.GetLogicHandler&#60;ILanguageHandler&#62;(); &#160;&#160;&#160; return from y in &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((from x in messageSystem.GetMessages(this.playerLogic.PlayerId) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orderby [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>/// &lt;summary&gt;     <br />/// Gets the dashboarditems of the player      <br />/// &lt;/summary&gt;      <br />/// &lt;param name=&quot;amount&quot;&gt;Number of items to be returned&lt;/param&gt;      <br />/// &lt;returns&gt;Enumeration of Dashboarditems&lt;/returns&gt;      <br />public IEnumerable&lt;DashboardItem&gt; GetDashboardItems(int amount)      <br />{      <br />&#160;&#160;&#160; var messageSystem = this.LogicSession.GetLogicHandler&lt;IMessageSystemLogic&gt;();      <br />&#160;&#160;&#160; var playerActionLogic = this.LogicSession.GetLogicHandler&lt;IPlayerActionLogic&gt;();      <br />&#160;&#160;&#160; var languageHandler = this.LogicSession.GetLogicHandler&lt;ILanguageHandler&gt;(); </p>
<p>&#160;&#160;&#160; return from y in     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((from x in messageSystem.GetMessages(this.playerLogic.PlayerId)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orderby x.Created      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; select x).Take(amount))      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; let z = playerActionLogic.GetPlayer(y.SenderId)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; let playername = z == null ?       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; languageHandler[&quot;/web/messagespage/system&quot;] :       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; z.GetData().Playername      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; select new DashboardItem(      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; playername,      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; y.Subject +       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (!string.IsNullOrEmpty (y.Content) ?&#160; &quot; &#8211; &quot; + y.Content : string.Empty),      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DashboardItem.DefaultType.Message,      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DateTime.Now);      <br />}</p>
</blockquote>
<p>Hin und wieder muss man einfach mal unkonventionell programmieren. Nicht das schönste Query, aber es funktioniert.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.depon.net/index.php/2009/08/22/manchmal-darf-es-eben-linq-sein/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

