简体   繁体   English

通过ssms返回的存储过程数据,但不是ef?

[英]Stored procedure data returned through ssms but not ef?

I have a GetSomeInfo() stored procedure which returns data like this when I execute it directly in SSMS: 我有一个GetSomeInfo()存储过程,当我直接在SSMS中执行数据时,它会返回如下数据:

PRODUCT  PROFIT
Widget1  9.50
Widget2  10.50
Widget3  8.50

I've auto-genned an ORM with EF6 in my console app. 我已经在控制台应用程序中使用EF6自动生成了ORM。 An object reference to the stored procedure was generated and the following result type is returned: 生成对存储过程的对象引用,并返回以下结果类型:

ObjectResult<GetSomeInfo_Result>

However, I'm not sure how to access the stored procedure results from this return object. 但是,我不确定如何从该返回对象访问存储过程的结果。 I tried creating a watch in the debugger to access different properties but I'm not having any luck in getting a handle to the actual data in this return object. 我尝试在调试器中创建一个手表来访问不同的属性,但是我对获取此返回对象中的实际数据没有任何运气。 Any idea how I can do this? 知道我该怎么做吗?

我只是在结果上调用ToList(),这给了我所需的信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM