title: Which is the best approach of calling Store Procedures in Entity Framework
body: <p>I have genereated a EF Model from a MS SQL database and I have included both StoredProcedures and Tables. I want to implement stored procedures in my project. Which is the best approach that has more advantages?</p>
  
  <pre><code>var data = db.DARs.SqlQuery("db.sp_GetEmployees").ToList();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>var data2 = db.sp_GetEmployees().ToList();
  </code></pre>
  
  <p>Here is full code:</p>
  
  <pre><code>private UniversityEntities1 db = new UniversityEntities1(); 
  
  public List&lt;DAR&gt; test()
  {    
      var data = db.DARs.SqlQuery("db.sp_GetEmployees").ToList();
      var data2 = db.sp_GetEmployees.ToList();
      return data;
  }
  </code></pre>