title: how to use stored procedure in asp.net core using EF
body: <p>I am working on an asp.net core application where I am using EF for database operations. In some cases, I need to use Stored procedures. So when I tried to do so, I get errors. The following is the code I used,</p>
  <pre><code>var result = await _context.Query&lt;EmployeeResult&gt;().FromSqlRaw(&quot;[usp_getEmployeedetails] @employeeID,@purpose&quot;, new SqlParameter(&quot;@employeeID&quot;, employeeID), new SqlParameter(&quot;@purpose&quot;, purpose)).ToListAsync(); 
  </code></pre>
  <p>Here the &quot;EmployeeResult&quot; is a ViewModel. Inside the Sp, I am using multiple tables to create the result select query.</p>
  <p>The error message as follows <code>&quot;Cannot create a DbSet for 'EmployeeResult' because this type is not included in the model for the context.&quot;</code></p>
  <p>Can anyone help me to resolve the issue?</p>