I have an entity ("A") that I'm persisting via NHibernate. This entity might have several children of type ("B") in the database, and when I retrieve entity A, I want to have a property that indicates a count of entity B that belong to A. I don't want to use a collection here because I don't have to have to retrieve all B entities just to count them.
Psuedo SQL to do what I want might look like:
select a.*, count(b.*) from a left join b on b.aid = a.id
Is this possible with NHibernate, and specifcally the LINQ provider?