I have the following query in SQL

SELECT company.*
FROM company c
WHERE EXISTS (SELECT * FROM company_suppliers WHERE supplier_id =
@supplier_id)

and am trying to recreate it in Linq To NHibernate, now the natural
sytax is something like

Supplier s = session.Get<Supplier>(3);

var companiers_that_use_supplier3 = session.Linq<Company>().Where
(c=>c.Suppliers.Contains(s));

Which currently doesn;t work, is there any way to do this without
dropping down to hql (and if I have to use hql how would this query be
formulated).

Thanks
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to