I have the following table structure and I want a turn the query into a NH criteria but I’m not sure how to incorporate the correct ‘Projection’, does anyone know how?

And the query I want to turn into a Criteria:
select ComponentId from Table_1
where [Name] = 'Contact' or [Name] = 'CurrencyPair'
group by ComponentId
having count(VersionId) = 2
I came across this question when trying to find a solution to my problem.
This post was useful.
In my case I was trying to return all records which have all the sub records the user specifies.
I ended up using a sub query which filters the sub records to the ones the user specified and returns the count, and checking that the count of the sub query equals the number of sub records the user specified.
Bit different from your scenario, but hope helps.