title: How to return id from NHibernate ISession.SaveOrUpdate
body: <p>I am using ISession.SaveOrUpdate to insert new objects and updaet existing.</p>
  
  <p>If I use ISession.Save(..) this returns the identity of the inserted record.</p>
  
  <p>For SaveOrUpdate I am doing the following:</p>
  
  <pre><code>   public int Save(Vehicle entity) {
          using (var txn = _session.BeginTransaction()) {
              _session.SaveOrUpdate(entity);
              txn.Commit();
          }
          return entity.Id;
      }
  </code></pre>
  
  <p>Is this the best way to return my identity?</p>
  
  <p>Thanks,</p>
  
  <p>Ben</p>