<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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: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>Comments on: Linq To Sql: Dynamic Where Clause</title>
	<atom:link href="http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/feed/" rel="self" type="application/rss+xml" />
	<link>http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 14:35:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Cláusulas &#8220;where&#8221; Dinâmicas usando LINQ to SQL no Visual Studio 2010 &#171; &#62;Compilar</title>
		<link>http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/#comment-2078</link>
		<dc:creator><![CDATA[Cláusulas &#8220;where&#8221; Dinâmicas usando LINQ to SQL no Visual Studio 2010 &#171; &#62;Compilar]]></dc:creator>
		<pubDate>Tue, 01 Mar 2011 20:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=692#comment-2078</guid>
		<description><![CDATA[[...] Fonte: http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/   Arquivado em Dicas     &#8592; Python é eleito a linguagem de&#160;2010   LikeBe the first to like this post. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Fonte: http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/   Arquivado em Dicas     &larr; Python é eleito a linguagem de&nbsp;2010   LikeBe the first to like this post. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mrkraju</title>
		<link>http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/#comment-1642</link>
		<dc:creator><![CDATA[Mrkraju]]></dc:creator>
		<pubDate>Tue, 25 May 2010 09:57:43 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=692#comment-1642</guid>
		<description><![CDATA[Thank you some much it helped me a lot and reduced the code lines..]]></description>
		<content:encoded><![CDATA[<p>Thank you some much it helped me a lot and reduced the code lines..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/#comment-1454</link>
		<dc:creator><![CDATA[dave]]></dc:creator>
		<pubDate>Sat, 30 Jan 2010 18:55:44 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=692#comment-1454</guid>
		<description><![CDATA[You can use the LINQKit&#039;s (http://www.albahari.com/nutshell/linqkit.aspx) Predicate builder to do the OR&#039;s and whatnot.  Of course you could also write your own, but it&#039;s pretty.]]></description>
		<content:encoded><![CDATA[<p>You can use the LINQKit&#8217;s (<a href="http://www.albahari.com/nutshell/linqkit.aspx" rel="nofollow">http://www.albahari.com/nutshell/linqkit.aspx</a>) Predicate builder to do the OR&#8217;s and whatnot.  Of course you could also write your own, but it&#8217;s pretty.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://rogeralsing.com/2009/11/21/linq-to-sql-dynamic-where-clause/#comment-1378</link>
		<dc:creator><![CDATA[Steven]]></dc:creator>
		<pubDate>Sat, 21 Nov 2009 19:06:46 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=692#comment-1378</guid>
		<description><![CDATA[I rather let the calling layer supply a query object that does this. The calling code could look like this:

var filter = EntityFilter
    .Where(c =&gt; c.Name == came)
    .Where(c =&gt; c.City == city);

var customers = FindCustomers(filter);

Your repository could now look like this:

Customer[] FindCustomers(IEntityFilter filter)
{
     var query = context.Customers;
     query = filter.Filter(query);
     return query.ToArray();
}

I wrote about this concept here: http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=66.

The code for this EntityFilter can be found on CodePlex, here: http://servicelayerhelpers.codeplex.com/SourceControl/changeset/view/32810#537055.

Cheers]]></description>
		<content:encoded><![CDATA[<p>I rather let the calling layer supply a query object that does this. The calling code could look like this:</p>
<p>var filter = EntityFilter<br />
    .Where(c =&gt; c.Name == came)<br />
    .Where(c =&gt; c.City == city);</p>
<p>var customers = FindCustomers(filter);</p>
<p>Your repository could now look like this:</p>
<p>Customer[] FindCustomers(IEntityFilter filter)<br />
{<br />
     var query = context.Customers;<br />
     query = filter.Filter(query);<br />
     return query.ToArray();<br />
}</p>
<p>I wrote about this concept here: <a href="http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=66" rel="nofollow">http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=66</a>.</p>
<p>The code for this EntityFilter can be found on CodePlex, here: <a href="http://servicelayerhelpers.codeplex.com/SourceControl/changeset/view/32810#537055" rel="nofollow">http://servicelayerhelpers.codeplex.com/SourceControl/changeset/view/32810#537055</a>.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
</channel>
</rss>

