title: Call a Scalar valued function in entity framework 6
body: <p>How can I call a scalar function in entity framework 6 ?
  I have tried the following code</p>
  
  <pre><code>        using (MhEntities DContext = new MhEntities())
          {
              var Account_IdParameter = Account_Id.HasValue ? new ObjectParameter("Account_Id", Account_Id) : new ObjectParameter("Account_Id", typeof(long));
              string res = ((IObjectContextAdapter)DContext).ObjectContext.CreateQuery&lt;string&gt;("MoneyforHealthEntities.Fn_LEVEL0_Acount_Id", Account_IdParameter).FirstOrDefault();
              return Convert.ToInt64(res);
          }
  </code></pre>