views:

8

answers:

0

I have a list of orders, which are connected to a user-table. Each order can contain multiple users.

I then have a search area where an admin can search through all orders by searching for e.g. a last name.

If there is done a search for e.g. Smith, all orders where a user named smith should be shown, but how is this done with NHibernate and Criterion?

I first tried (users is a list of users):

crit.CreateCriteria("Users").Add(Restrictions.Like("LastName", Users))

but with no success.