how do you map a Component list in Nhibernate fluently?
public class Registration : Entity
{
public virtual IList<InsuranceInformation> InsuranceInformation { get; set; }
}
public class InsuranceInformation
{
public virtual Person Insured { get; set; }
public virtual string PolicyNumber { get; set; }
public virtual string InsuranceCompanyId { get; set; }
public virtual string InsuranceCompanyName { get; set; }
public virtual string PlanType { get; set; }
public virtual string GroupNumber { get; set; }
public virtual FamilyRelationships InsuredRelationshipToPatient { get; set; }
}
Here Registration is an Entity and InsuranceInformation / Person are Components.
If I change InsuranceInformation to be a Entity, I can map it easily with FluentNH Automapper. But when I change InsuranceInformation to a Component it throws a mapping exception.
Fluent NHibernate IDictionary with composite element mapping shows an example of mapping a dictionary of components:
Hopefully that will point you in the right direction.