5

What is the usage of Session.Merge method in NHibernate?

When can we use of this method?

masoud ramezani
  • 22,228
  • 29
  • 98
  • 151
  • Possible duplicate of [NHibernate - Difference between session.Merge and session.SaveOrUpdate?](http://stackoverflow.com/questions/170962/nhibernate-difference-between-session-merge-and-session-saveorupdate) – Bernhard Hofmann Mar 02 '17 at 15:25

1 Answers1

7

Try look here:

NHibernate - Difference between session.Merge and session.SaveOrUpdate?

from the above post:

You should use Merge() if you are trying to update objects that were at one point detached from the session, especially if there might be persistent instances of those objects currently associated with the session. Otherwise, using SaveOrUpdate() in that case would result in an exception.

Community
  • 1
  • 1
danyolgiax
  • 12,798
  • 10
  • 65
  • 116