且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用实体获取存储过程结果,但不使用edmx?

更新时间:2022-10-23 21:50:20

有一个查看DataContext对象上可用函数调用的概述



您可以将实体连接转换为它的基类DataContext并继续编写您已概述的代码。



http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext_methods(v = vs.110)的.aspx

I want my result set into collection using entity, but without using edmx file, for e.g whenever we add stored procedure into edmx file, it automatically generate class for that stored procedure, as many stored procedure you add that many class you get, so i don't want that to happen, i want just to pass stored procedure name and parameter and that should return back the result set into collection

Have a look at the overview of what function calls are available on the DataContext object

You can cast an entity connection to it's base class DataContext and go ahead writing the code you have outlined.

http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext_methods(v=vs.110).aspx