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 SP with EF. There are few examples how to use Stored Procedures with Entity Framework, but none specific for Asp.Net MVC Code First (at least I couldn't find any). They are a good start but I need something more, better information and better examples!
I have this SP:
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()
EndSo @Name,@Salary,@Gender are input parameters, and @EmployeeId is an outpud parameter, it shows me the ID of the new added employee.
So can someone tell me how to use Entity Framework (Code-first) to call the stored procedures and with the parameters.