title: c# - IDENT_CURRENT in Linq-to-Entities
body: <p>I am using Linq-to-Entities in my Windows Application and want to execute this SQL statement:</p>
  
  <pre><code>SELECT IDENT_CURRENT ('ProductInfo') AS Current_Identity
  </code></pre>
  
  <p>I have read another post that is using <code>Database.SqlQuery</code> like this:</p>
  
  <pre><code>int varMaxAdvertiseId = Convert.ToInt32(hmd.Database.SqlQuery&lt;decimal&gt;("Select IDENT_CURRENT ('HMDAdvertiseManage')", new object[0]).FirstOrDefault());
  </code></pre>
  
  <p>but this is not working with me (intelisense is not showing it) Can someone help me, please ?</p>