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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.