处理实体框架存储过程 [英] Handle Stored Procedure in Entity Framework

查看:118
本文介绍了处理实体框架存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何处理存储过程,在实体Framwork返回不同的输出。
例如,在SP,有if条件和其他条件。如果条件返回整数和其他条件回报数据表。如何处理与本使用实体框架
请指点。

How to handle stored procedure that returns different outputs in Entity Framwork. For example , on sp, there is if condition and else condition. if condition return integer and else condition return datatable. How to handle this using entity framework in vs. Please advice.

推荐答案

EF4不支持使用多个不同类型的回报存储过程。我们可以通过SQL codeS用SP的直接调用做到这一点无论是或可以在LINQ做的模式。

Ef4 does not support stored procedure with multiple returns of different types. We can do it either by direct calling of Sp via sql codes or can do the schema in linq.

否则,我们需要使用EF 4.1及以上。

Else we needs to use EF 4.1 and above.

这篇关于处理实体框架存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆