title: EF6 querying a stored procedure
body: <p>I am using Entity Framework 6 to call a stored procedure called <code>AlarmTransPro</code>. The procedure takes no input parameters as returns a table which has been declared within a model c# file in the project:</p>
  
  <pre><code>public partial class AlarmTransPro_Result
  {
      public Nullable&lt;int&gt; id { get; set; }
      public Nullable&lt;double&gt; data1 { get; set; }
      public Nullable&lt;double&gt; data1max { get; set; }
      public Nullable&lt;double&gt; data1min { get; set; }
      public Nullable&lt;int&gt; Transitioned { get; set; }
  }
  </code></pre>
  
  <p>I know the procedure logic and query works in isolation via its implementation in sqlfiddle: <a href="http://sqlfiddle.com/#!6/7e149/5" rel="nofollow">sqlfiddle</a></p>
  
  <p>When I implement this method:</p>
  
  <pre><code>var alarmview = alarms.Database.SqlQuery&lt;AlarmTransPro_Result&gt;("AlarmTransPro").ToList();
  </code></pre>
  
  <p>and set a breakpoint when I mouse over I get a <code>Raw View</code> where <code>count=0</code></p>
  
  <p>If I try with the <code>.ToList()</code> i.e.</p>
  
  <pre><code>var alarmview = alarms.Database.SqlQuery&lt;AlarmTransPro_Result&gt;("AlarmTransPro")
  </code></pre>
  
  <p>then on mouse over I get <code>Non Public Members</code> and a <code>Results View</code>. The <code>Non Public Members</code> contains <code>Internal Query</code>and one of the sub fields is <code>sql parameters</code> and the has the string <code>object{0}</code>. The <code>Results View</code> states that </p>
  
  <blockquote>
    <p>Children could not be evaluated</p>
  </blockquote>
  
  <p>I feel that I am close, but I am not sure if:</p>
  
  <ol>
  <li>My query method is correct? </li>
  <li>Do I need to include or make better provision in the query for the returned parameters?</li>
  <li>Is it working and my method of inspection wrong?</li>
  </ol>