How to call Stored Procedure in Entity Framework 6 (Code-First)?

前端 未结 21 2088
滥情空心
滥情空心 2020-11-22 05:04

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         


        
21条回答
  •  难免孤独
    2020-11-22 06:10

    You can call a stored procedure in your DbContext class as follows.

    this.Database.SqlQuery("storedProcedureName",params);
    

    But if your stored procedure returns multiple result sets as your sample code, then you can see this helpful article on MSDN

    Stored Procedures with Multiple Result Sets

提交回复
热议问题