How could I declare a parameter(ids) and add it to where part of select in NHibernate using ICriteria API?
DECLARE @ids xml ='<ScopeIds><id>417444AC-6C57-4CB7-91E1-6E0B5832EDBB</id></ScopeIds>'
SELECT * FROM MyTable p
WHERE
/* other criterion list */
AND @ids.exist('/ScopeIds[id=sql:column("ScopeId")]') = 1
One way here could be
SqlProjection: