I have set up my mapping file and classes as suggested by many articles
class A { ... IList BBag {get;set;} ... }
class B { ... A aObject {get;set;} ... }
<class name="A">...<bag name="BBag" table="B" inverse="true" lazy="false"><key column="A_ID" /><one-to-many class="B" /></bag>...
<class name="B">...<many-to-one name="aObject" class="A" column="A_ID" />...
I added a set of A's to the A table and a set of B's to the B table, all the data is stored
as expected. However if I try and access aInstance.BBag.Count
I get a null reference exception. I think I missing some key knowledge on how an bag gets instantiated.
Thanks