<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Include() behavior</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Include() behavior</description>
  <pubDate>Mon, 13 Apr 2026 19:41:39 -700</pubDate>
  <lastBuildDate>Tue, 11 Jan 2011 08:59:15 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2430</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Include() behavior : That works well - Thanks much!...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2430&amp;PID=9623#9623</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2430<br /><strong>Posted:</strong> 11-Jan-2011 at 8:59am<br /><br /><div><br></div>That works well - Thanks much!]]>
   </description>
   <pubDate>Tue, 11 Jan 2011 08:59:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2430&amp;PID=9623#9623</guid>
  </item> 
  <item>
   <title>Include() behavior :   Hi, chuckYou should rather...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2430&amp;PID=9604#9604</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=825" rel="nofollow">gkneo</a><br /><strong>Subject:</strong> 2430<br /><strong>Posted:</strong> 10-Jan-2011 at 9:17am<br /><br />Hi, chuck<div><br></div><div><span ="apple-style-span"="" style="font-family: C&#111;nsolas; line-height: normal; font-size: 13px; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><font ="apple-style-span"="" color="#333333"><br></font></span></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span ="apple-style-span"="" style="font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; ">You should &nbsp;rather use:</span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; "><br></span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; ">q = q.Include ("Provider.Person");</span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; "><br></span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; ">That way, q is a new IEntityQuery with the Where and Include statements you have specified.</span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; "><br></span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; ">The "delta" (19 seconds) is ok as it has to query the server for every iteration looking for "Provider" and "Person", because the Include statement was not effective.</span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; "><br></span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; "><br></span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; ">Regards,</span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; "><br></span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; "><br></span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span ="apple-style-span"="" style="color: rgb0, 0, 0; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; ">Guillermo.</span></span></font></div><div><font ="apple-style-span"="" face="C&#111;nsolas" size="2"><span ="apple-style-span"="" style="line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span ="apple-style-span"="" style="font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; line-height: 16px; ">&nbsp;</span></span></font></div><span style="font-size:10px"><br /><br />Edited by gkneo - 10-Jan-2011 at 9:20am</span>]]>
   </description>
   <pubDate>Mon, 10 Jan 2011 09:17:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2430&amp;PID=9604#9604</guid>
  </item> 
  <item>
   <title>Include() behavior : I&amp;#039;ve run across an unexpected...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2430&amp;PID=9600#9600</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2430<br /><strong>Posted:</strong> 09-Jan-2011 at 9:41am<br /><br /><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; "><font ="Apple-style-span" face="C&#111;nsolas"><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p>I've run across an unexpected behavior when using Include(). &nbsp;It appears that appending an Include to the query after initial declaration is not effective.</o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p>The code below illustrates what I'm seeing. &nbsp;Notice where the Include is used and the resulting time required to run the navigation property access test loop.</o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes"><br></span></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#2B91AF">IEntityQuery</span>&lt;<span style="color:#2B91AF">Certificate</span>&gt; q =<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:  blue">new</span> <span style="color:#2B91AF">EntityQuery</span>&lt;<span style="color:#2B91AF">Certificate</span>&gt;().Where(c =&gt; c.IsActive == <span style="color:blue">true</span> &amp;&amp;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>c.PolicyPeriod.ExpirationDate &gt; System.<span style="color:#2B91AF">DateTime</span>.Now&amp;&amp;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>(c.Provider.SpecialtyId == pediatricianSpecialityId || <o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>c.Provider.SpecialtyId == emergencyMedicineSpecialityId))<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font ="Apple-style-span" color="#FF0000"></font></span><font ="Apple-style-span" color="#FF0000">.Include("Provider.Person");</font><o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p>&nbsp;</o:p></span><span ="Apple-style-span" style="font-size: 13px; "><span style="mso-spacerun:yes">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span>_certificates = <span style="color:#2B91AF">iCatalystEntityManager</span>.DefaultManager.ExecuteQuery(q).ToList();</span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p>&nbsp;</o:p></span><span ="Apple-style-span" style="font-size: 13px; "><span style="mso-spacerun:yes">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:blue">string</span> n;</span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#2B91AF">DateTime</span> start = <span style="color:#2B91AF">DateTime</span>.Now;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:blue">foreach</span> (<span style="color:#2B91AF">Certificate</span>c <span style="color:blue">in</span> _certificates)<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>{<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>n =c.Provider.Person.DisplayName;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>}<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#2B91AF">TimeSpan</span> delta = <span style="color:#2B91AF">DateTime</span>.Now - start;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font ="Apple-style-span" color="#FF0000">&nbsp;&nbsp;&nbsp;</font></span><font ="Apple-style-span" color="#FF0000">// delta = 0.014 seconds</font><o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p>&nbsp;</o:p></span></p><p ="Ms&#111;normal" style="font-size: small; "><o:p>&nbsp;</o:p><span ="Apple-style-span" style="font-size: 13px; ">&nbsp;</span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p>&nbsp;Changed code, rebuilt and re-run.</o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#2B91AF">IEntityQuery</span>&lt;<span style="color:#2B91AF">Certificate</span>&gt; q =<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:  blue">new</span> <span style="color:#2B91AF">EntityQuery</span>&lt;<span style="color:#2B91AF">Certificate</span>&gt;().Where(c =&gt; c.IsActive == <span style="color:blue">true</span> &amp;&amp;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>c.PolicyPeriod.ExpirationDate &gt; System.<span style="color:#2B91AF">DateTime</span>.Now&amp;&amp;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>(c.Provider.SpecialtyId == pediatricianSpecialityId || <o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>c.Provider.SpecialtyId ==emergencyMedicineSpecialityId));<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font ="Apple-style-span" color="#FF3399">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font ="Apple-style-span" color="#FF0000">&nbsp;</font></span><font ="Apple-style-span" color="#FF0000">q.Include("Provider.Person");// &lt;&lt; applying after initial query creation isineffective<o:p></o:p></font></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p><font ="Apple-style-span" color="#FF0000">&nbsp;</font></o:p></span><span ="Apple-style-span" style="font-size: 13px; "><span style="mso-spacerun:yes">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span>_certificates = <span style="color:#2B91AF">iCatalystEntityManager</span>.DefaultManager.ExecuteQuery(q).ToList();</span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><o:p>&nbsp;</o:p></span><span ="Apple-style-span" style="font-size: 13px; "><span style="mso-spacerun:yes">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:blue">string</span> n;</span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#2B91AF">DateTime</span> start = <span style="color:#2B91AF">DateTime</span>.Now;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:blue">foreach</span> (<span style="color:#2B91AF">Certificate</span>c <span style="color:blue">in</span> _certificates)<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>{<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>n =c.Provider.Person.DisplayName;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>}<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#2B91AF">TimeSpan</span> delta = <span style="color:#2B91AF">DateTime</span>.Now - start;<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; font-size: small; "><span style="font-size:  9.5pt;font-family:C&#111;nsolas"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font ="Apple-style-span" color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><font ="Apple-style-span" color="#FF0000">// delta = 19 seconds</font><o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; "><font ="Apple-style-span" color="#FF0000" size="2"><span ="Apple-style-span" style="color: rgb0, 0, 0; font-size: 13px; ">Thanks</span></font></p><p ="Ms&#111;normal" style="margin-bottom: 0.0001pt; line-height: normal; "><font ="Apple-style-span" color="#FF0000" size="2"><span ="Apple-style-span" style="color: rgb0, 0, 0; font-size: 13px; ">&nbsp;</span></font></p></font></p>]]>
   </description>
   <pubDate>Sun, 09 Jan 2011 09:41:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2430&amp;PID=9600#9600</guid>
  </item> 
 </channel>
</rss>