Merge Function In Entity FrameWork?

Posted by Ahmed on Stack Overflow See other posts from Stack Overflow or by Ahmed
Published on 2010-05-12T13:14:40Z Indexed on 2012/09/15 3:38 UTC
Read the original article Hit count: 194

In NHibernate there is a merge function that does the following:

  • 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

Is this possible 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?

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about entity-framework