实体生命周期 [英] Entity Lifecycle

查看:186
本文介绍了实体生命周期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



因为我在另一个帖子中提到的上下文线索,所以试图赶上这里的东西。



我的问题是围绕DataContext和实体的生命周期。有几个人暗示,一旦Context检索到一个对象,任何再次从Context中检索该对象的尝试都会产生另一个DB往返。



这是真的吗?



我一直假设Context为此目的保留了实例,然后可能会提高如果更新未通过货币检查,则会出错。



情况不是这样吗?

解决方案
凸块

Hello all,

 

Just trying to catch up on something here because of the context clues I am picking up in another thread.

 

My question is around the DataContext and the lifecycle of an entity.  Several folks have implied that once an object is retrieved by the Context, any attempt to retrieve that object from the Context again will generate another DB roundtrip.

 

Is that true? 

 

I have been assuming that the Context keeps the instance around for just this purpose and then would, presumably, raise an error if an update fails a currency check. 

 

Is that not the case?

解决方案

bump


这篇关于实体生命周期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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