How do you pass a list of things for the \'in\' clause in Nhibernate HQL?
e.g.
// data input from the user interface, not known at compile time
object[]
Use SetParameterList()
.
Code snippet from billsternberger.net:
ArrayList stateslist = new ArrayList();
stateslist.Add("TX");
stateslist.Add("VA");
string hql = String.Format("FROM Contact c where State in (:states)");
SimpleQuery q = new SimpleQuery(hql);
q.SetParameterList("states", stateslist);
Contact[] result = q.Execute();