Site Loading

Using the In statement with NHibernate

This is a simple solution to using the IN statement in fluent NHibernate:

_session.QueryOver<Model>()
.WhereRestrictionOn(x => x.Id)
.IsIn(intList)
.List<Model>();

In the example above, I am trying to get all models where the Id is in the intList.

Close