We have a search routine that uses criteria to build SQL query (because its restrictions added dynamically). In a particular case (a very complicated case) we need to search over a table-valued function.(our model object is mapped to the function).
The result would be something like this :
SELECT count(*) FROM dbo.GetSubStaffsLetterInstances(@staffId) WHERE LetterNumber="1234";
The problem is I don't know how to pass @staffId to my criteria(I tried adding an Eq restrictions without success since restrictions are working on properties) I know I can add a parameter to an IQuery but I don't know how I can do it using an ICriteria object.