处理实体框架存储过程
问题描述:
如何处理存储过程,在实体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.