Hi
I'm getting a strange NHibernate exception when I try and create a SessionFactory. I've narrowed down the exception 'Unable to cast object of type 'NHibernate.Mapping.Bag' to type 'NHibernate.Mapping.IKeyValue' to the following mapping on the Company object:
<bag name="Images" cascade="none">
<key column="CompanyId" property-ref="Images"/>
<one-to-many class="GwDbImage"/>
</bag>
This is the mapping for GwDbImage:
<class name="GwDbImage" table="Images" >
<id name="ImageId">
<column name="ImageId" sql-type="int" not-null="true"/>
<generator class="native"/>
</id>
<property name="FileName" />
The definition of Images on the Company object is as follows:
public virtual IList<GwDbImage> Images { get; set; }
I know it's vague but does anyone know what is wrong / point me in the right direction?
Thanks
Jon