Is there any way to query stored procedure in Fluent Nhibernate without creating an hbm.xml file mapping?
I assume you use the standard
Session.GetNamedQuery(....
instead, you can use
var result = Session.CreateSQLQuery("exec MyStoredProc :pUserId, :pIsLocked")
.AddEntity(typeof(MyDomainObject))
.SetParameter("pUserId", userId)
.SetParameter("pIsLocked", isLocked)
.List<MyDomainObject>();
This allows you to call the stored proc but still get back a domain object (or list of) without needing a .hbm.xml file.
Actually there's this post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With