无法将System.Data.Entity.Core.Objects.ObjectResult类型隐式转换为System.Data.Objects.ObjectResult

Aki*_*oto 7 c# entity-framework

我正在尝试更新EDMX存储过程,我收到此错误:

无法隐式转换System.Data.Entity.Core.Objects.ObjectResult<X>System.Data.Objects.ObjectResult<X>

我正在使用Visual Studio 2012.

Ste*_*Cav 20

我有错误,这些解决方案都没有工作(我已经在使用System.Data.Entity.Core.Objects,它也在context.tt等等).

我终于意识到键盘和椅子之间存在问题.存储过程完成了选择,但我试图:

MyStoredProc_Result r = dbcontext.MyStoredPoc();
Run Code Online (Sandbox Code Playgroud)

代替

MyStoredProc_Result r = dbcontext.MyStoredPoc().FirstOrDefault();
Run Code Online (Sandbox Code Playgroud)


Sac*_*rma 10

context.tt以XML模式打开文件并进行更改

using System.Data.Objects;
Run Code Online (Sandbox Code Playgroud)

using System.Data.Entity.Core.Objects;
Run Code Online (Sandbox Code Playgroud)