选择存储过程 [英] select stored procs

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

问题描述

我有一些非常大的视图,我需要从Silverlight应用程序返回小数据集(不确定它是否相关),是否可以使用实体框架的select存储过程,还是有更好的方法?

Hi,
I have some very large views that I need to return small sets of data from, to a Silverlight application (not sure if its relevant), is it possible to use a select stored proc with entity framework, or is there a better way?

推荐答案

您好,您可以在EF中使用选择存储过程。您可以将结果映射到实体,复杂类型(在EF4中)或简单类型。您可以阅读我撰写的关于此主题的帖子以获得示例: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/03/13/mapping-stored-procedure-results -to-A-自定义实体的实体 - framework.aspx
另外,还有其他方法可以在EF中进行选择。
例如,您可以使用LINQ to Entities在实体数据模型上执行选择操作。
这取决于你想要达到的目的。
Hi,
You can use select stored procedures in EF. You can map their results to entities, complex type (in EF4) or simple types. You can read a post I wrote regarding this subject to get an example: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/03/13/mapping-stored-procedure-results-to-a-custom-entity-in-entity-framework.aspx.
Also, there are other ways to do select in EF.
For example you can use LINQ to Entities to perform select operation on the Entity Data Model.
This depend on what you want to achieve.


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

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