Consider the following entities:
Package Manifest Content
---------- ---------- ----------
Id PackageId Id
Name ContentId Name
Status
The relationship is many-to-many where a package can have multiple contents and contents can belong to multiple packages.
What I'd like to do is, for a given Package.Id
, get the count of all Content
which have a specific Status
.
My mapping works fine, but I have not been able to figure out how to achieve a conditional count of the Content
without loading the Content
. One option is to use an ApplyChildFilter
in the mapping and use with ExtraLazyLoad
, but this means I'd have to create a dedicated property just for this.
Is there a way to achieve this without falling back on CreateSQLQuery
?