<?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 : EdmFunctionAttribute not working in WPF</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2012 : EdmFunctionAttribute not working in WPF</description>
  <pubDate>Sat, 11 Apr 2026 08:09:24 -700</pubDate>
  <lastBuildDate>Thu, 17 Jan 2013 15:22:46 -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=3898</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>EdmFunctionAttribute not working in WPF :   EdmFunctions such as this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3898&amp;PID=15623#15623</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> 3898<br /><strong>Posted:</strong> 17-Jan-2013 at 3:22pm<br /><br />EdmFunctions such as this are still supported.&nbsp; These functions can be used only with the DataSourceOnly QueryStrategy, since the query cannot be run against cache.&nbsp; When it is run against cache you'll see that exception hit, since the C# method is being called.]]>
   </description>
   <pubDate>Thu, 17 Jan 2013 15:22:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3898&amp;PID=15623#15623</guid>
  </item> 
  <item>
   <title>EdmFunctionAttribute not working in WPF :  We are currently converting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3898&amp;PID=15613#15613</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=945" rel="nofollow">mseeli</a><br /><strong>Subject:</strong> 3898<br /><strong>Posted:</strong> 17-Jan-2013 at 3:32am<br /><br />We are currently converting a Silerlight application into WPF.<div>We have some server side sqlfunctions defined.</div><div><br></div><div><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#091;<span style="color:#2b91af;">EdmFunction</span>(<span style="color:#a31515;">"VIS6Model.Store"</span>,&nbsp;<span style="color:#a31515;">"CacheField"</span>)&#093;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:blue;">static</span>&nbsp;<span style="color:blue;">string</span>&nbsp;CacheField(<span style="color:blue;">string</span>&nbsp;s1,&nbsp;<span style="color:blue;">int</span>&nbsp;i1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">throw</span>&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">NotSupportedException</span>(<span style="color:#a31515;">"This&nbsp;function&nbsp;can&nbsp;only&nbsp;be&nbsp;used&nbsp;in&nbsp;a&nbsp;LINQ&nbsp;to&nbsp;Entities&nbsp;query"</span>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;">the usage looks like this:</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;"><pre style="font-family: C&#111;nsolas; -: initial initial; -repeat: initial initial;"><span style="color:#2b91af;">      IEntityQuery</span>&lt;<span style="color:#2b91af;">MasterEntityDb</span>&gt;&nbsp;enq&nbsp;=&nbsp;VisContext.VisRepository.Manager.GetQuery&lt;<span style="color:#2b91af;">MasterEntityDb</span>&gt;();</pre><pre style="font-family: C&#111;nsolas; -: initial initial; -repeat: initial initial;"><span style="line-height: 1.4;">      enq&nbsp;=&nbsp;enq.OrderByDescending(x&nbsp;=&gt;&nbsp;</span><span style="line-height: 1.4; color: rgb43, 145, 175;">MySqlLinqFunctions</span><span style="line-height: 1.4;">.CacheField(x.Cache,&nbsp;SortFieldIdx));</span></pre></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;"><pre style="font-family: C&#111;nsolas; -: initial initial; -repeat: initial initial;"><span style="color:blue;">      var</span>&nbsp;<span style="line-height: 1.4;">searchQuery </span><span style="line-height: 1.4;">=&nbsp;enq.Where(SearchPredicate).Take(PageSize);</span></pre></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;"><pre style="font-family: C&#111;nsolas; -: initial initial; -repeat: initial initial;"><span style="color:blue;">      var</span>&nbsp;results&nbsp;=&nbsp;(<span style="color:blue;">await</span>&nbsp;VisContext.VisRepository.Manager.ExecuteQueryAsync(searchQuery)).ToList();</pre><pre style="font-family: C&#111;nsolas; -: initial initial; -repeat: initial initial;"><br></pre><pre style="font-family: C&#111;nsolas; -: initial initial; -repeat: initial initial;">(<span style="line-height: 1.4;">VisContext.VisRepository.Manager is the DevForce Entity Manager)</span></pre></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;">It works fine in Silverlight but when we run in on the WPF Client we get the NotSupportedException from above.</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;">Is this an known issue?</pre></div><div><br></div><div><br></div><span style="font-size:10px"><br /><br />Edited by mseeli - 17-Jan-2013 at 3:35am</span>]]>
   </description>
   <pubDate>Thu, 17 Jan 2013 03:32:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3898&amp;PID=15613#15613</guid>
  </item> 
 </channel>
</rss>