实体框架不使用存储过程! [英] Entity Framework doesn't work with stored procedures!

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

问题描述

这是真的,你不能叫SP与EF除非该SP返回的实体?

Is it true that you cannot call an sp with the EF unless the sp returns an entity?

为了测试我在3函数导入一个SP与1没有返回类型2.标量返回类型和3的实体返回类型

To test I created 3 Function Imports for an sp with 1. no return type 2. a scalar return type and 3. an entity return type

然后当我键入DataContext的然后。我只得到智能感知的,它返回一个实体的功能!

then when i type "DataContext" then "." I only get intellisense on the function that returns an entity!

我很惊讶,这不是当前的功能!

I'm surprised this isn't a current feature!

什么是使用作为一种解决方法的人吗?

What are people using as a workaround?

推荐答案

有一种方法!

朱莉勒曼写了一篇关于这一点。有一个在她的博客:<一href="http://thedatafarm.com/blog/data-access/implement-select-stored-procedures-that-return-miscellaneous-data-in-ctp2-of-ef-designer/" rel="nofollow">http://thedatafarm.com/blog/data-access/implement-select-stored-procedures-that-return-miscellaneous-data-in-ctp2-of-ef-designer/

Julie Lerman wrote a post about this. Have a look at her blog: http://thedatafarm.com/blog/data-access/implement-select-stored-procedures-that-return-miscellaneous-data-in-ctp2-of-ef-designer/

这对我帮助很大,以实现我的存储过程。

It helped me a lot to implement my stored procedures.

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

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