session.GetIdentifier(item)?
On Monday, 15 September 2014 05:15:10 UTC+2, Nguyễn Trung wrote:
>
> Hi all
>
> How i can get id entity after transaction like Save, Update and Delete.
> Ex: Update method:
>
> public void Update<T>(T item)
> {
> using (ISession session = OpenSession())
> {
> using (session.BeginTransaction())
> {
> try
> {
> session.Update(item);
> session.Transaction.Commit();
> long id=??
>
> }
> catch (Exception ex)
> {
> session.Transaction.Rollback();
> throw new Exception("Can not Update !\n\b" +
> ex.Message);
> }
> finally
> {
> session.Close();
> }
> }
> }
> }
>
> Thank all.
>
>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.