![](/img/trans.png)
[英]In Entity Framework database-first approach how to return multiple result sets from a stored procedure?
[英]how to get the result from stored procedure in entity framework + database first
我正在创建 web api 并使用实体框架数据库第一种方法并使用存储过程。
存储过程从表中返回结果列并返回值(0 或 1)。 在 c# 代码中使用存储过程我想显示结果列。 但这并没有发生。
我的 web api 代码如下
public async Task<GetRequestDetailsResponse> FetchPASCodeDetail(string SearchField, string SearchValue )
{
GetRequestDetailsResponse getRequestDetailsResponse = new GetRequestDetailsResponse();
getRequestDetailsResponse = context.sp_GetRequestDetails(SearchField, SearchValue) //here i am getting the exception - can not implicitly convert int to GetRequestDetailsResponse
return getRequestDetailsResponse
}
所以我想显示结果列而不是返回值。
TIA
context.sp_GetRequestDetails 是什么样的? 您是否生成它以返回复杂类型?
另请参阅: 实体框架数据库中的存储过程第一种方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.