<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET MVC Storefront Starter Kit</title><link>http://forums.asp.net/1165.aspx</link><description>This forum is for any and all questions pertaining to the ASP.NET MVC Storefront Starter Kit. The Storefront  is a sample ASP.NET MVC Commerce application which was developed using Test-driven Development, Inversion of Control (IoC), and Dependency Injection.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: CompiledQuery.Compile and repository</title><link>http://forums.asp.net/thread/3062086.aspx</link><pubDate>Fri, 03 Apr 2009 22:55:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3062086</guid><dc:creator>mmeisinger</dc:creator><author>mmeisinger</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3062086.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1165&amp;PostID=3062086</wfw:commentRss><description>&lt;p&gt;great question&lt;br /&gt;i guess it really depends on the query&lt;/p&gt;
&lt;p&gt;so the CompiledQuery.Compile method will take the underlying expression tree and evaluate it down to code&lt;br /&gt;this helps the execution time of the query since it doesn&amp;#39;t have to be evaluated prior to execution&lt;/p&gt;
&lt;p&gt;it does this at the time the method is &amp;quot;jit-ted&amp;quot; so you really only gain the performance after the first time the method is called (since the expression tree has to be evaluated first, of course)&lt;/p&gt;
&lt;p&gt;so back to my original point...&lt;br /&gt;if you have expressions that don&amp;#39;t change (except for the values in your conditional statements) then it might be a candidate for &amp;quot;compiling&amp;quot; the query&lt;br /&gt;e.g. in the example it has Func&amp;lt;Northwind, string, IQueryable&amp;lt;Customer&amp;gt;&amp;gt; so the only things that can change are the reference to the Northwind data context and the string parameter&lt;/p&gt;
&lt;p&gt;if your expression changes the conditionals or adds joins etc... then clearly you can&amp;#39;t compile it&lt;/p&gt;
&lt;p&gt;the next thing to look for is if the query is called enough times to make it worth your while&lt;br /&gt;if the query isn&amp;#39;t called that frequently then it might not be worth it&lt;/p&gt;
&lt;p&gt;hope that helps&lt;/p&gt;</description></item><item><title>CompiledQuery.Compile and repository</title><link>http://forums.asp.net/thread/3059610.aspx</link><pubDate>Fri, 03 Apr 2009 03:54:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3059610</guid><dc:creator>Ruffone</dc:creator><author>Ruffone</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3059610.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1165&amp;PostID=3059610</wfw:commentRss><description>&lt;font size="3" face="Times New Roman"&gt;
&lt;div&gt;&lt;font size="2" face="Arial"&gt;I am reading about compile queries (CompiledQuery.Compile) and was wondering if it would add anything to the repository and if it would&amp;nbsp;what might be the best way to&amp;nbsp;implemented it.&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Arial"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb399335.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb399335.aspx&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;/font&gt;</description></item></channel></rss>