Please note that this is pre-AutoMap which I haven't dived into yet, but I thought it would be nice to share none-the-less.
public class LeadMap :
ClassMap
{
public LeadMap()
{
Id(o => o.Id);
Map(o => o.CreatedOn);
Component(o => o.Company,
x =>
{
x.Map(m => m.Name);
x.Map(m => m.Address);
x.Map(m => m.Website);
x.Map(m => m.Telephone);
});
Component(o => o.Contact,
x =>
{
x.Map(m => m.Name);
x.Map(m => m.Telephone);
x.Map(m => m.Email);
x.Map(m => m.Title);
});
Component(o => o.Survey,
x =>
{
x.Map(m => m.DoTheyWantToBeAnAgent);
x.Map(m => m.WhatTypeOfAgentDoTheyWantToBe);
x.Map(m => m.FoundUsVia);
x.Map(m => m.InBizSector);
x.Map(m => m.WantsAFollowUpCall);
x.Map(m => m.WantsToKnowAboutMainProducts);
x.Map(m => m.WantsToKnowAboutOtherProducts);
x.Map(m => m.WantsToKnowAboutPricing);
});
HasMany(o => o.InterestedIn)
.Component(x=> {
x.TableName = "Lead_Items";
x.Map(m => m.ItemId);
}
).AsSet();
}
}