如何自动加载自我跟踪实体的导航属性? [英] How to auto-load navigation properties of Self Tracking Entities?

查看:60
本文介绍了如何自动加载自我跟踪实体的导航属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑从POCO动态代理转向STE,因为WCF可能会参与其中。


我很好奇是否有办法自动加载导航属性STE的?

解决方案


如果您在模型中定义了Referencial约束,那么您可以右键单击您的EDMX模型并设置"启用延迟加载"属性为true。


如果使用Linq加载数据,并且禁用了延迟加载,则可以使用Include()方法根据需要加载模型的所有相关表。 / p>

希望这可以帮到你,


JAReyes。


We're considering convering from POCO dynamic proxies to STE since WCF might play a part on this.

I'm curious if there's a way to autoloading navigation properties for STE's?

解决方案

Hi,

If you have defined Referencial constraints in your model, then you can right-click your EDMX model ans set "Lazy Loading Enabled" property to true.

If you load data using Linq, and lazy load is disabled, you can use Include() method to load all related tables of your model as you need.

Hope this can help you,

JAReyes.


这篇关于如何自动加载自我跟踪实体的导航属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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