NHibernate - where clause include result from a STORED PROC?
I have this stored procedure "spIsAuthorized" with an OUT param "IsAuthorized" of type CHAR (Y=yes authorized and N=not authorized)
Now my question is, without access control checking I normally load the objects using ICriteria/or/IQuery
Now how do I filter (add to oCriteria or where-clause of oQuery) so that only those authorized is returned? Basically I want to do something like this:
IList lstResult = oQuery.List();
IList lstResult = oCriteria.List();
* spIsAuthorized=stored proc
oCriteria.Add( Expression.Eq("spIsAuthorized", "UserId=123,ActionId=2", "Y") )
* UserId and ActionId are input param to stored proc
* Y = output param of stored proc, "IsAuthorized".