Using NHibernate with Output Parameters

Does anyone know if NHibernate supports return parameters from stored procedures? I had a search in the documentation, but I can not find anything that would be confirmed in any case.

+6
stored-procedures nhibernate
source share
2 answers

I can’t officially confirm for you, but, as far as I know, not directly. Using a stored procedure in NHibernate is very specific to running standard CRUD.

If you want to capture output parameters (which are not standard row output parameters for INSERT, UPDATE, and DELETE), you can return to other (or standard) database access tools that give you direct access to SQL and the result set. (Assuming you can bypass the NHibernate cache. You want you to flush NHibernate before you run the request, etc.)

+3
source share

I had the same problem. NHibernate does not allow you to use stored procedures in this way. But this allows calls to be made using the plain old ADO.NET API. Here is an example -

http://refactoringaspnet.blogspot.com/2009/06/how-to-use-legacy-stored-procedures-in.html

+7
source share

All Articles