tags:

views:

89

answers:

1

When I am adding a new row in the database, I noticed the Add method returns void.

Is it possible to get the newly created row's ID returned in the add operation?

+1  A: 

When you call session.Save() on your entity, your entity should have the Id modified.

You probably want to check your nhibernate configuration if your save is occurring immediately or if your saving is batching. If it's batching, then you'll need to commit (or flush, someone will correct this... hopefully) your session.

Min