I have objects
Account { int id }
Contact { int id, int accountId }
they have other name, address, etc. fields. I have placed these on a multimapindex so that I can allow users to perform a search across types.
When I get the Account object back though, I need to find out if that account has any contacts.
I tried a foreach loop on the accountIds with
session.Load<Contact>().Where(x => x.AccountId == accountId).ToList()
and also tried
session.Query<Contact>().Where(x => x.AccountId == accountId).ToList()
but neither of these approaches worked.
I know I can do a bulk load of data by passing in a list of docids, but I don't know what those are.
I've looked at the help on denormalizing data, but I can't seem to figure out how to get this to work. Do I need the account object to include a list of its contacts ids? I'm trying to avoid that if possible, but not sure how to get this to work. Any help would be appreciated.
Thanks!