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<Contact> q = new SimpleQuery<Contact>(hql);
q.SetParameterList("states", stateslist);
Contact[] result = q.Execute();