title: EF Core 2.0 how to use SQL stored procedure
body: <p>I am new to EF Core 2.0 with stored procedure.</p>
  
  <p>Can anyone help how to use stored procedure in my EF Core 2.0 code-first approach?</p>
  
  <p>With my previous project, I had an <code>.edmx</code> model file, and I was using the context as below:</p>
  
  <pre><code>public IEnumerable&lt;UserResult&gt; GetUserResults(Entities context)
  {
      if (context == null) return new List&lt;UserResult&gt;();
      return context.spGetUsers().Where(u =&gt; u.IsDeleted == false);
  }
  </code></pre>
  
  <p>and the context is:</p>
  
  <pre><code>public virtual ObjectResult&lt;UserResult&gt; spGetUsers()
  {
      return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction&lt;UserResult&gt;("spGetUsers");
  }
  </code></pre>
  
  <p>Thanks</p>