<?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>Biggle&#039;s Blog &#187; LINQ</title>
	<atom:link href="http://www.biggle.de/blog/tag/linq/feed" rel="self" type="application/rss+xml" />
	<link>http://www.biggle.de/blog</link>
	<description>Web- und Software Development</description>
	<lastBuildDate>Tue, 07 Feb 2012 13:08:02 +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>foreach oder LINQ</title>
		<link>http://www.biggle.de/blog/foreach-oder-linq</link>
		<comments>http://www.biggle.de/blog/foreach-oder-linq#comments</comments>
		<pubDate>Sat, 20 Nov 2010 10:18:30 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=5941</guid>
		<description><![CDATA[Anhand eines einfachen Beispiels möchte ich darstellen, wie man ein verschachteltes foreach-Statement auch mit LINQ umsetzen kann. Ich habe ein Autohaus und möchte dem Kunden gerne jedes Auto in meinem Sortiment in jeder Farbe anbieten. Dazu benötige ich die Klassen Car und CarColor. Ich erstelle mir eine Liste von Autos und eine Liste von Farben. [...]]]></description>
			<content:encoded><![CDATA[<p>Anhand eines einfachen Beispiels möchte ich darstellen, wie man ein verschachteltes foreach-Statement auch mit LINQ umsetzen kann.</p>
<p><em>Ich habe ein Autohaus und möchte dem Kunden gerne jedes Auto in meinem Sortiment in jeder Farbe anbieten.</em></p>
<p>Dazu benötige ich die Klassen <em>Car </em>und <em>CarColor</em>. Ich erstelle mir eine Liste von Autos und eine Liste von Farben.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">List<span style="color: #339933;">&lt;</span>Car<span style="color: #339933;">&gt;</span> cars <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> List<span style="color: #339933;">&lt;</span>Car<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">new</span> Car <span style="color: #009900;">&#123;</span> Name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;BMW&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">new</span> Car <span style="color: #009900;">&#123;</span> Name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Audi&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">new</span> Car <span style="color: #009900;">&#123;</span> Name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Seat&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
List<span style="color: #339933;">&lt;</span>CarColor<span style="color: #339933;">&gt;</span> colors <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> List<span style="color: #339933;">&lt;</span>CarColor<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">new</span> CarColor <span style="color: #009900;">&#123;</span> Color <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;blau&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">new</span> CarColor <span style="color: #009900;">&#123;</span> Color <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;rot&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">new</span> CarColor <span style="color: #009900;">&#123;</span> Color <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;gelb&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Nun möchte ich jedes Auto jede Farbe zuweisen.<br />Mit verschachtelte foreach-Schleifen sähe das so aus:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> car in cars<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> color in colors<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        Console<span style="color: #339933;">.</span>WriteLine<span style="color: #009900;">&#40;</span>String<span style="color: #339933;">.</span>Format<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;{0} in {1}&quot;</span><span style="color: #339933;">,</span> car<span style="color: #339933;">.</span>Name<span style="color: #339933;">,</span> color<span style="color: #339933;">.</span>Color<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>hässlich oder?<br />Mit LINQ kann ich dieses wie folgt programmieren:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">List<span style="color: #339933;">&lt;</span>string<span style="color: #339933;">&gt;</span> offers <span style="color: #339933;">=</span> cars<span style="color: #339933;">.</span>SelectMany<span style="color: #009900;">&#40;</span>color <span style="color: #339933;">=&gt;</span> colors<span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>car<span style="color: #339933;">,</span> color<span style="color: #009900;">&#41;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>String<span style="color: #339933;">.</span>Format<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;{0} in {1}&quot;</span><span style="color: #339933;">,</span> car<span style="color: #339933;">.</span>Name<span style="color: #339933;">,</span> color<span style="color: #339933;">.</span>Color<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>ToList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
offers<span style="color: #339933;">.</span><span style="color: #b1b100;">ForEach</span><span style="color: #009900;">&#40;</span>offer <span style="color: #339933;">=&gt;</span> Console<span style="color: #339933;">.</span>WriteLine<span style="color: #009900;">&#40;</span>offer<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p>Ich finde Zweiteres sieht um einiges lesbarer aus, oder was sagst du?</p>
<p><br class="spacer_" /></p>
<p>Viel Spaß beim entwickeln : )</p>
<p><br class="spacer_" /></p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5941" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>30. August 2010 -- <a href="http://www.biggle.de/blog/doppelte-eintraege-aus-einer-datatable-entfernen-linqextension" title="Doppelte Einträge aus einer DataTable entfernen | LinqExtension">Doppelte Einträge aus einer DataTable entfernen | LinqExtension</a></li><li>1. Januar 2010 -- <a href="http://www.biggle.de/blog/net-quicky-linq2ef-videorial" title=".Net Quicky &#8211; Linq2Ef Videorial">.Net Quicky &#8211; Linq2Ef Videorial</a></li><li>5. November 2009 -- <a href="http://www.biggle.de/blog/geschwindigkeitsvorteile-mit-vorkompilierten-linq-queries" title="Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries">Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries</a></li><li>12. Oktober 2009 -- <a href="http://www.biggle.de/blog/linq-tools" title="LINQ Tools">LINQ Tools</a></li><li>31. Juli 2009 -- <a href="http://www.biggle.de/blog/mit-linq2xml-innerhalb-einer-foreach-serialisieren" title="Mit LINQ2XML innerhalb einer foreach serialisieren">Mit LINQ2XML innerhalb einer foreach serialisieren</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/foreach-oder-linq/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Doppelte Einträge aus einer DataTable entfernen &#124; LinqExtension</title>
		<link>http://www.biggle.de/blog/doppelte-eintraege-aus-einer-datatable-entfernen-linqextension</link>
		<comments>http://www.biggle.de/blog/doppelte-eintraege-aus-einer-datatable-entfernen-linqextension#comments</comments>
		<pubDate>Mon, 30 Aug 2010 14:51:19 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Quicky]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=5304</guid>
		<description><![CDATA[Folgende LINQExtension* enternt doppelte Einträge einer DataTable und gibt diese zurück 1 2 3 4 5 6 7 8 9 10 public static DataTable DistinctDataTable&#40;this DataTable table&#41; &#123; var resultTable = table.Clone&#40;&#41;; IEnumerable&#60;DataRow&#62; uniqueElements = table.AsEnumerable&#40;&#41;.Distinct&#40;DataRowComparer.Default&#41;; foreach &#40;var row in uniqueElements&#41; &#123; resultTable.ImportRow&#40;row&#41;; &#125; return resultTable; &#125; Verwendung: DataTable resultTable = mainTable.DistinctDataTable&#40;&#41;; Viel Spaß beim [...]]]></description>
			<content:encoded><![CDATA[<p>Folgende LINQExtension* enternt doppelte Einträge einer DataTable und gibt diese zurück</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> static DataTable DistinctDataTable<span style="color: #009900;">&#40;</span>this DataTable table<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> resultTable <span style="color: #339933;">=</span> table<span style="color: #339933;">.</span>Clone<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    IEnumerable<span style="color: #339933;">&lt;</span>DataRow<span style="color: #339933;">&gt;</span> uniqueElements <span style="color: #339933;">=</span> table<span style="color: #339933;">.</span>AsEnumerable<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>Distinct<span style="color: #009900;">&#40;</span>DataRowComparer<span style="color: #339933;">.</span><span style="color: #b1b100;">Default</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> row in uniqueElements<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        resultTable<span style="color: #339933;">.</span>ImportRow<span style="color: #009900;">&#40;</span>row<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> resultTable<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Verwendung:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">DataTable resultTable <span style="color: #339933;">=</span> mainTable<span style="color: #339933;">.</span>DistinctDataTable<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Viel Spaß beim entwickeln : )</p>
<p>* = ExtensionMethods implementiert man in einer statischen Klasse.</p>
<p>&nbsp;</p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5304" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>4. November 2011 -- <a href="http://www.biggle.de/blog/wie-verhindere-ich-beim-klick-eines-hyperlinkbuttons-in-silverlight-die-umrandung-quicky" title="Wie verhindere ich beim Klick eines HyperlinkButtons in Silverlight die Umrandung &#8211; Quicky">Wie verhindere ich beim Klick eines HyperlinkButtons in Silverlight die Umrandung &#8211; Quicky</a></li><li>31. März 2011 -- <a href="http://www.biggle.de/blog/wie-ermittle-ich-eine-telefonnummer-aus-dem-telefonbuch-%e2%80%93-wp7-quicky" title="Wie ermittle ich eine Telefonnummer aus dem Telefonbuch? – WP7 Quicky">Wie ermittle ich eine Telefonnummer aus dem Telefonbuch? – WP7 Quicky</a></li><li>14. Februar 2011 -- <a href="http://www.biggle.de/blog/texttrimming-xaml-quicky" title="TextTrimming &#8211;  XAML Quicky">TextTrimming &#8211;  XAML Quicky</a></li><li>14. Februar 2011 -- <a href="http://www.biggle.de/blog/doppelklick-im-datagrid-abfangen-wpf-quicky" title="Doppelklick im DataGrid abfangen &#8211; WPF Quicky">Doppelklick im DataGrid abfangen &#8211; WPF Quicky</a></li><li>27. November 2010 -- <a href="http://www.biggle.de/blog/windows-phone-7-trialmode-testversion-wp7-quicky" title="Windows Phone 7 Trialmode – WP7 Quicky">Windows Phone 7 Trialmode – WP7 Quicky</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/doppelte-eintraege-aus-einer-datatable-entfernen-linqextension/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Net Quicky &#8211; Linq2Ef Videorial</title>
		<link>http://www.biggle.de/blog/net-quicky-linq2ef-videorial</link>
		<comments>http://www.biggle.de/blog/net-quicky-linq2ef-videorial#comments</comments>
		<pubDate>Fri, 01 Jan 2010 18:25:05 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Videorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=3584</guid>
		<description><![CDATA[In diesem (mein erstes btw) Videorial zeige ich unter 5 Minuten, wie man Customer-Daten aus der BeispielDatenbank Northwind via Entity Framework an eine ComboBox bindet. Ich empfehle gleich nach dem Start auf HD umzustellen, das schärft die Schriften. Viel Spass beim entwickeln : ) Dieser Beitrag stammt von Mario Priebe. Ähnliche Beiträge5. November 2009 -- [...]]]></description>
			<content:encoded><![CDATA[<p>In diesem (mein erstes btw) Videorial zeige ich unter 5 Minuten, wie man Customer-Daten aus der BeispielDatenbank Northwind via Entity Framework an eine ComboBox bindet.</p>
<p>Ich empfehle gleich nach dem Start auf HD umzustellen, das schärft die Schriften.</p>
<p><a href="http://www.biggle.de/blog/net-quicky-linq2ef-videorial"><em>Für die Feedleser, dem Artikel ist ein Video eingefügt ; )</em></a></p>
<p>Viel Spass beim entwickeln : )</p>
<p><br class="spacer_" /></p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3584" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>5. November 2009 -- <a href="http://www.biggle.de/blog/geschwindigkeitsvorteile-mit-vorkompilierten-linq-queries" title="Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries">Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries</a></li><li>6. August 2009 -- <a href="http://www.biggle.de/blog/basta-2009-ich-bin-dabei" title="Basta! 2009&hellip; ich bin dabei">Basta! 2009&hellip; ich bin dabei</a></li><li>4. März 2009 -- <a href="http://www.biggle.de/blog/einfaches-linq2sql-beispiel" title="Einfaches LINQ2SQL Beispiel">Einfaches LINQ2SQL Beispiel</a></li><li>13. Januar 2009 -- <a href="http://www.biggle.de/blog/keydown-in-asp-net-csharp" title="KeyDown in ASP .NET &#8211; CSharp">KeyDown in ASP .NET &#8211; CSharp</a></li><li>19. November 2008 -- <a href="http://www.biggle.de/blog/technical-summit-2008-tag-1-pre-conference" title="Technical Summit 2008 &#8211; Tag 1 / Pre-Conference">Technical Summit 2008 &#8211; Tag 1 / Pre-Conference</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/net-quicky-linq2ef-videorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries</title>
		<link>http://www.biggle.de/blog/geschwindigkeitsvorteile-mit-vorkompilierten-linq-queries</link>
		<comments>http://www.biggle.de/blog/geschwindigkeitsvorteile-mit-vorkompilierten-linq-queries#comments</comments>
		<pubDate>Thu, 05 Nov 2009 19:00:35 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=3149</guid>
		<description><![CDATA[Um Geschwindigkeitsvorteile bei der Verwendung von LINQ zu genießen, sollte man einen Blick auf Precompiled Linq Queries werfen.]]></description>
			<content:encoded><![CDATA[<p>Um Geschwindigkeitsvorteile bei der Verwendung von LINQ zu genießen, sollte man einen Blick auf <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbS9kZS1kZS9saWJyYXJ5L3N5c3RlbS5kYXRhLm9iamVjdHMuY29tcGlsZWRxdWVyeS5jb21waWxlLmFzcHg=">Precompiled Linq Queries</a> werfen.</p>
<p>Hier ein kleines Beispiel, wie der vorkompilierte Query erstellt und verwendet wird.</p>
<p>Ein unkompilierter Query:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> customers <span style="color: #339933;">=</span> from c in CustomerContext<span style="color: #339933;">.</span>customer
              where c<span style="color: #339933;">.</span>lastName<span style="color: #339933;">.</span>Contains<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pri&quot;</span><span style="color: #009900;">&#41;</span>
              select c<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Nachfolgend ein kompilierter Query:</p>
<p>Die Variable welche den vorkompilierten Query speichern soll, definieren wir wie folgt:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> readonly Func<span style="color: #339933;">&lt;</span>CustomerContext<span style="color: #339933;">,</span> string<span style="color: #339933;">,</span> IQueryable<span style="color: #339933;">&lt;</span>Customer<span style="color: #339933;">&gt;&gt;</span> getCustomersByName<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Und mit Zuweisung sieht das ganze wie folgt aus:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">getCustomersByName <span style="color: #339933;">=</span>
            CompiledQuery<span style="color: #339933;">.</span>Compile<span style="color: #339933;">&lt;</span>CustomerContext<span style="color: #339933;">,</span> string<span style="color: #339933;">,</span> IQueryable<span style="color: #339933;">&lt;</span>Customer<span style="color: #339933;">&gt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CustomerContext context<span style="color: #339933;">,</span> lastName<span style="color: #009900;">&#41;</span>
                <span style="color: #339933;">=&gt;</span> from c in context<span style="color: #339933;">.</span>Customer 
                   where c<span style="color: #339933;">.</span>LastName<span style="color: #339933;">.</span>Contains<span style="color: #009900;">&#40;</span>lastName<span style="color: #009900;">&#41;</span> 
                   select c<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Und verwendet wird das ganze später dann wie folgt:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> customers <span style="color: #339933;">=</span> getCustomersByName<span style="color: #339933;">.</span>Invoke<span style="color: #009900;">&#40;</span>CustomerContext<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Pri&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3149" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>7. Februar 2011 -- <a href="http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden" title="SQLite Datenbanken in C# Applikationen verwenden">SQLite Datenbanken in C# Applikationen verwenden</a></li><li>9. Januar 2011 -- <a href="http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c" title="Mehrfachvererbung – Ein Beispiel in C#">Mehrfachvererbung – Ein Beispiel in C#</a></li><li>22. Januar 2010 -- <a href="http://www.biggle.de/blog/praktische-muster-commands" title="Praktische Muster &#8211; Commands">Praktische Muster &#8211; Commands</a></li><li>17. Januar 2010 -- <a href="http://www.biggle.de/blog/attribute-mittels-reflektion-abfragen" title="Attribute mittels Reflektion abfragen">Attribute mittels Reflektion abfragen</a></li><li>4. Januar 2010 -- <a href="http://www.biggle.de/blog/webservices-auf-erreichbarkeit-pruefen" title="Webservices auf Erreichbarkeit prüfen">Webservices auf Erreichbarkeit prüfen</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/geschwindigkeitsvorteile-mit-vorkompilierten-linq-queries/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LINQ Tools</title>
		<link>http://www.biggle.de/blog/linq-tools</link>
		<comments>http://www.biggle.de/blog/linq-tools#comments</comments>
		<pubDate>Mon, 12 Oct 2009 21:58:55 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=3035</guid>
		<description><![CDATA[ThinqLinq stellt einige nützliche Tools, kategorisiert nach Samples, Profiler, Desginer, Code Generatoren und Provider, rund um LINQ zusammen]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy50aGlucWxpbnEuY29tL1Bvc3QuYXNweC9Qb3N0SWQvMjIwNzY=">ThinqLinq</a> stellt einige nützliche Tools, kategorisiert nach Samples, Profiler, Desginer, Code Generatoren und Provider, rund um LINQ zusammen</p>
<p>Auf <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NoYXJwdG9vbGJveC5jb20vY2F0ZWdvcmllcy9saW5x">SharpToolbox</a> sind weitere nette Tools zu finden.</p>
<p><a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGUvYmxvZy93cC1jb250ZW50L3VwbG9hZHMvMjAwOS8xMC9saW5xLmpwZw==" rel=\"thumbnail\"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="linq" border="0" alt="linq" src="http://www.biggle.de/blog/wp-content/uploads/2009/10/linq_thumb.jpg" width="520" height="345" /></a></p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3035" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>7. Juni 2010 -- <a href="http://www.biggle.de/blog/generic-list-sortieren-csharp-quicky" title="Generic.List<T> sortieren | C# Quicky">Generic.List<T> sortieren | C# Quicky</a></li><li>22. Dezember 2009 -- <a href="http://www.biggle.de/blog/windows-neu-starten-wpf-quicky" title="Windows neu starten &#8211; WPF Quicky">Windows neu starten &#8211; WPF Quicky</a></li><li>22. Dezember 2009 -- <a href="http://www.biggle.de/blog/restart-neustart-wpf-applikation" title="Restart einer WPF Applikation">Restart einer WPF Applikation</a></li><li>5. November 2009 -- <a href="http://www.biggle.de/blog/geschwindigkeitsvorteile-mit-vorkompilierten-linq-queries" title="Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries">Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries</a></li><li>25. Oktober 2009 -- <a href="http://www.biggle.de/blog/string-nach-pascal-und-camelcase-c-quicky" title="String nach Pascal- und CamelCase &#8211; C# Quicky">String nach Pascal- und CamelCase &#8211; C# Quicky</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/linq-tools/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

