<?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 : Using EntitySQL questions</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Using EntitySQL questions</description>
  <pubDate>Thu, 16 Apr 2026 10:45:57 -700</pubDate>
  <lastBuildDate>Thu, 10 Nov 2011 18:35:08 -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=3087</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>Using EntitySQL questions :   Thanks for response! I already...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3087&amp;PID=12031#12031</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3087<br /><strong>Posted:</strong> 10-Nov-2011 at 6:35pm<br /><br />Thanks for response! I already found that info on DRC. Reason I went with ESQL so I can decouple my model from my UI little better. <div></div><div>LINQ sounds much better from compile time validation standpoint. I will look over my code once again and see if I can use it.</div>]]>
   </description>
   <pubDate>Thu, 10 Nov 2011 18:35:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3087&amp;PID=12031#12031</guid>
  </item> 
  <item>
   <title>Using EntitySQL questions :    Hi katit,For the first problem,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3087&amp;PID=12030#12030</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 3087<br /><strong>Posted:</strong> 10-Nov-2011 at 6:14pm<br /><br />Hi katit,<div>&nbsp;</div>For the first problem, you can use the EntityMetadataStore to retrieve the entity set name for the entity type, which is what Esql is expecting here.&nbsp; Something like,<div>&nbsp; var&nbsp;entitySetName =&nbsp; entityManager.MetadataStore.GetEntityMetadata(typeof(T)).DefaultEntitySetName;</div><div>&nbsp;</div><div>An Esql query is always a "data source only" query, so doesn't take advantage of caching.&nbsp; The entities are loaded into the EntityManager cache, however, so you can still do cache-only LINQ queries to retrieve and filter already loaded data.</div><div>&nbsp;</div><div>If you switch to dynamic SQL, since these queries are LINQ queries you can take advantage of different query strategies, and cache query optimizations.&nbsp; Dynamic SQL is actually intended for a situation like yours.&nbsp;&nbsp; We don't have any full code samples, but there's quite a bit of information on&nbsp;the DRC - <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/dynamic-queries" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/dynamic-queries</a>.</div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Thu, 10 Nov 2011 18:14:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3087&amp;PID=12030#12030</guid>
  </item> 
  <item>
   <title>Using EntitySQL questions :   Consider this code that I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3087&amp;PID=12027#12027</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3087<br /><strong>Posted:</strong> 10-Nov-2011 at 10:23am<br /><br />Consider this code that I use:<div>&nbsp;</div><p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">esqlString = </font></font><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas">"SELECT VALUE e FROM "</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> + </font></font><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas">typeof</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">(T).Name + </font></font><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas">"s AS e"</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">;</font></font><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">As you see, I've got generic class of &lt;T&gt; where T : Entity</font></font></div><div><font size="2" face="C&#111;nsolas"></font>&nbsp;</div><div><font size="2" face="Arial, Helvetica, sans-serif">So, when I need to get records for this entity - I use query above. Problem is that I have to add "s" to specify that I'm querying collection of &lt;T&gt;</font></div><div><font size="2" face="Arial, Helvetica, sans-serif"></font>&nbsp;</div><div><font size="2" face="Arial, Helvetica, sans-serif">1. I wonder if I can somehow use entityManager to get collection name if I know typeof(T) ? My main concern is that I'm hardcoding and I'm not sure how pluralizing really works. will it add "s" everywhere or there is exception list and I will get bitten by this one day?</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">2. I noticed that when I started using entity SQL&nbsp;- I don't get caching anymore. I wonder if there any techniques where I can achieve dynamic query and also retain caching? To get you an idea why I'm using esql: </font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><img src="uploads/1264/Capture.JPG" height="277" width="528" border="0" /></div>]]>
   </description>
   <pubDate>Thu, 10 Nov 2011 10:23:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3087&amp;PID=12027#12027</guid>
  </item> 
 </channel>
</rss>