Expert |
 |
Joined: Fri Oct 28, 2005 5:38 pm Posts: 390 Location: Cedarburg, WI
|
ISession.Refresh() changes the instances of entity and collection properties on the refreshed object. This sounds like a very bad idea, because who knows what code was referencing the old instances of those entity and collection properties.
Why would Refresh() be implemented to have this horrible side effect? Was it just the easiest way to do it, and no one thought about the consequences? I thought it was standard practice that properties always return the same instance as long as logical meaning of the value has not changed, and that collection properties in particular should never change their underlying instance during the owning object's lifetime.
|
|