简体   繁体   English

ProxyCreationEnabled = false是否等于实体框架中的AsNoTracking()?

[英]Is ProxyCreationEnabled = false is equal to AsNoTracking() in Entity framework?

Is ProxyCreationEnabled = false is equal to AsNoTracking() in Entity framework? ProxyCreationEnabled = false是否等于实体框架中的AsNoTracking()?

And we can use AsNoTracking() in table level. 我们可以在表级别使用AsNoTracking()。 but how to use AsNoTracking() in stored procedures. 但是如何在存储过程中使用AsNoTracking()。

Proxies and tracking are two different, but combinable concepts. 代理和跟踪是两个不同但可组合的概念。

Proxies generate a derived class at runtime for advanced features like lazy loading, property changed, etc. While proxies are usually coupled with a tracking context, the don't necessarily have to. 代理在运行时生成诸如延迟加载,属性更改等高级功能的派生类。虽然代理通常与跟踪上下文结合在一起,但不一定必须如此。

Tracking indicates whether or not your open context saves a reference to the returned object and is able to detect changes to it. 跟踪指示您的打开上下文是否保存对返回对象的引用,并能够检测到对其的更改。 It can do this with or without proxies. 它可以在有或没有代理的情况下执行此操作。 Without proxies the context "simply compares" all tracked references to their initial state when you call Save() . 在没有代理的情况下,调用Save()时,上下文会将所有跟踪的引用“简单地比较”为其初始状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM