Given the following domain model:
Dog { Id, Name, Color }
Color { Id, Name }
How do I get the Colors for which there are dogs with NHibernate.Linq. In SQL I would
SELECT Color.Id, Color.Name FROM Color
WHERE Id IN
(SELECT DISTINCT Dog.ColorId FROM Dog);
This might work:
However if you are matching purely on the color identifier, try this instead:
These will give you all of the colors which are used by the dogs.