如何使用 EDM 创建包含引用实体的函数导入/存储过程
有谁知道如何在实体数据模型中创建函数导入,该函数返回返回还包括引用类型的实体类型的集合。例如,在 LINQ to 实体中,您可以使用 .Include() 方法从数据库加载某个引用的实体。我有一个从两个表返回数据的存储过程,我想从该存储过程填充两个实体对象,但是当我逐步执行向导来创建函数导入时,它只提供了在以下位置创建一种实体类型的集合的选项:一次。
非常感谢任何帮助。
Does anybody know how to create a function import in an Entity Data Model that returns a collection of entity types that also includes the reference types. For instance, in LINQ to entities you can use the .Include() method to load a certain referenced entity from the DB. I have a stored procedure that returns data from two tables and I want to populate both entity objects from this stored procedure, but when I step through the wizard to create the function import, it only gives the option of creating collections of one entity type at a time.
Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,它不受支持。 EFv4 中的存储过程只能返回直接映射到单个选定实体类型的单个结果集。关系未填充。
如果还想加载关系,您必须手动填充实体。
As I know it is not supported. Stored procedures in EFv4 can return only single result set which is directly mapped to single selected entity type. Relations are not populated.
You must populate entities manually if want to load relations as well.