NHibernate handling mutliple resultsets from a sp call

Posted by Michael Baldry on Stack Overflow See other posts from Stack Overflow or by Michael Baldry
Published on 2009-11-05T21:46:11Z Indexed on 2010/06/03 16:14 UTC
Read the original article Hit count: 455

I'm using a stored procedure to handle search on my site, it includes full text searching, relevance and paging. I also wanted it to return the total number of results that would have been returned, had paging not being there. So I've now got my SP returning 2 select statements, the search and just SELECT @totalResults.

Is there any way I can get NHibernate to handle this? I'm currently accessing the ISession's connection, creating a command and executing the SP myself, and mapping the results. This isn't ideal, so I'm hoping I can get NH to handle this for me.

Or if anyone has any other better ways of creating complicated searches etc with NH, I'd really like to hear it.

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about stored-procedures