title: Call stored procedures with Entity Framework 6 code first approach in Asp.Net MVC 5
body: <p>We are using Ado.Net for working with the database from our C# code in ASP.NET MVC. I want to work with Entity Framework, so I need to use stored procedures with it, call stored procedures from EF.</p>
  
  <p>There are few examples how to use stored procedures with Entity Framework, but none specific for ASP.NET MVC and code-first (at least I couldn't find any). </p>
  
  <p>They are a good start but I need something more, better information and better examples!</p>
  
  <p>I have this stored procedure:</p>
  
  <pre><code>Create Procedure spAddEmployee  
      @Name nvarchar(50),  
      @Gender nvarchar(20),  
      @Salary int,  
      @EmployeeId int Out  
  as  
  Begin  
      Insert into tblEmployees 
      values(@Name, @Gender, @Salary)  
  
      Select @EmployeeId = SCOPE_IDENTITY()  
   End
  </code></pre>
  
  <p>So <code>@Name</code>, <code>@Salary</code>, <code>@Gender</code> are input parameters, and <code>@EmployeeId</code> is an output parameter, it returns the <code>ID</code> of the newly added employee.</p>
  
  <p>Can someone tell me how to use Entity Framework (code-first) to call this stored procedure with the parameters?</p>