I am very new to Entity Framework 6 and I want to implement stored procedures in my project. I have a stored procedure as follows:
ALTER PROCEDURE [dbo].[ins
You can pass parameters to sp_GetById and fetch the results either in ToList() or FirstOrDefault();
sp_GetById
ToList()
FirstOrDefault();
var param = new SqlParameter("@id", 106); var result = dbContext .Database .SqlQuery("dbo.sp_GetById @id", param) .FirstOrDefault();