I have an existing stored procedure in my database. I also have an existing database context class as well (fragment code only).
Would you please help advise how do I call my stored procedure from my controller? What is the missing class or property in my model or DatabaseContext
?
Thanks very much in advance
Sothun
CREATE PROCEDURE getEmployeeById
@employeeId nvarchar(7)
AS SELECT * FROM employees WHERE id = @employeeId GO;
namespace Template.Models
{
public class DatabaseContext : DbContext
{
public DatabaseContext() : base("dbConnectionString")
{
}
public DbSet<Parameter> parameter { get; set; }
//...
}
}