NHibernate: Execute stored procedure with return value

less than 1 minute read

Most of our stored procedures return an error code using RETURN 0 statement. I was unable to find how to get this value, when executing such procedures using NHibernate session.

I found this issue discussed on SO back in 2009 and nothing ever since. It might be that I my search skills are too weak :)

The solution that you can find in that SO question, worked. I made some changes in it to make it more usable. You can find my gist here.