views:

152

answers:

1

when i use NHibernate i can find Merg function in session which do that :

* if there is a persistent instance with the same identifier currently associated with the session, copy the state of the given object onto the persistent instance
* if there is no persistent instance currently associated with the session, try to load it from the database, or create a new persistent instance
* the persistent instance is returned

what about doing the sam in Ef ?

i mean this part : copy the state of the given object onto the persistent instance

and if i used ApplyCurrentValues it seemes to be as update behavior or not?

A: 

You're looking for ObjectQuery.MergeOption.

Craig Stuntz