更新时间:2022-11-04 18:27:02
Add->.函数导入
. GetCountryListSP
,从下拉列表中选择过程,然后选择返回值该过程的名称为实体
,然后从下拉列表中选择 CountryName
.然后在代码中:
Add -> Function Import
.GetCountryListSP
, choose your procedure from the drop down list, and choose the return value of the procedure to be Entities
and choose CountryName
from the drop down list.Then in the code:
var result = db.GetCountryListSP();//Send parameters too
使用这种方法,可以防止返回存储过程的 -1
.请查看这篇帖子,以获取有关存储过程问题的更多详细信息实体框架.
With this approach you prevent returning -1
of the stored procedure. Please check this post for more details about stored procedure problem with Entity Framework.