title: Calling scalar function from c# using Entity Framework 4.0 / .edmx
body: <p>I would like to map my scalar function to my .edmx but it fails. I right click on my entity framework mapping, and choose update model from database. It appears in my stored procedures folder in my model browser.</p>
  
  <p>However, when I want to add it to my <code>Function Imports</code> folder in the model browser, the message <strong>scalar function does not appear</strong> shows in the drop down list. Can someone help me?</p>
  
  <p>I can call the scalar function using the old way, such as: </p>
  
  <pre><code>dbContext.ExecuteStoreQuery&lt;DateTime?&gt;(
  "SELECT dbo.getMinActualLoadDate ({0}, {1}, {2}) AS MyResult", 
  LoadPkid, LoadFkStartLoc, TripSheetPkid).First();
  </code></pre>
  
  <p>but it is not the best way. My manager would like me to find a way be able to put the scalar function in the "function import" folder so I can call the scalar function using the following code instead of the previous code:</p>
  
  <pre><code>dbContext.ExecuteFunction("getMinActualLoadDate ", paramList);
  </code></pre>
  
  <p>I tried to add an image to display what I mean but as my reputation is still low, I am unable to do so. However the image could be found here: <a href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/756865e5-ff25-4f5f-aad8-fed9d741c05d">http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/756865e5-ff25-4f5f-aad8-fed9d741c05d</a></p>
  
  <p>Thanks.</p>