I have some objects:
Public Class Person() {
public int Id {get;set;}
public IList<Account> Accounts {get;set;}
public string Email {get; set;}
}
public class Account(){
public int Id {get;set;}
public IList<AccountPayment> Payments {get;set;}
public IList<Venue> Venues {get;set;}
}
public class AccountPayment(){
public int Id {get;set;}
public DateTime PaymentDate {get;set;}
public decimal PaymentAmount {get;set;}
}
public class Venue(){
public int Id {get;set;}
public string AddressLine1 {get;set;}
public string Postcode {get;set;}
}
These classes are mapped to MS Sql with nHibernate - there is a table in the db per class...
I want to create a method in my repository, GetAccounts(int PersonID), that will return a List with all the account's child collections populated in the most efficient way. Can anyone give me any pointers on how to do this - I do not really want to set up the lists as subselects in my mappings if I can help it...
Thanks.