How do I Insert or Update (or overwrite) a record using NHibernate?

后端 未结 6 1625
忘掉有多难
忘掉有多难 2021-02-02 00:51

I need to write a row to the database regardless of whether it already exists or not. Before using NHibernate this was done with a stored procedure. The procedure would attempt

6条回答
  •  误落风尘
    2021-02-02 01:11

    call hibernate.saveOrUpdate() which will check if the object is in the database, update it if it is, and save (i.e. insert) it if it is not.

提交回复
热议问题