In my AutoPersistanceModel setup I have this in my mapping
.ForTypesThatDeriveFrom<Customer>(autoMap =>
{
autoMap.Id(p =>
p.Id).GeneratedBy.Assigned().SetAttribute("length", "5");
autoMap.Map(p =>
p.CompanyName).Not.Nullable();
autoMap.Component<Address>(p
=> p.Address, addr =>
{
addr.Map(c => c.Street, "Address");
addr.Map(c => c.State, "Region");
addr.Map(c => c.City, "City");
addr.Map(c => c.Country, "Country");
addr.Map(c => c.PostalCode, "PostalCode");
});
})
.ForTypesThatDeriveFrom<Order>(autoMap =>
{
autoMap.References(p =>
p.ShipVia, "ShipVia");
autoMap.Component<Address>(p =>
p.Address, addr =>
{
addr.Map(c => c.Street, "ShipAddress");
addr.Map(c => c.State, "ShipRegion");
addr.Map(c => c.City, "ShipCity");
addr.Map(c => c.Country, "ShipCountry");
addr.Map(c => c.PostalCode, "ShipPostalCode");
});
})
})
Should AutoMap.Component return down to Auto map for the component
instead of just map so I don't need to have my redundant mappings
addr.Map(x => x.City, "City");
addr.Map(x => x.Country, "Country");
In the second one for <Order> is there anyway I can reach back up to
convention.GetComponentColumnPrefix = type => string.Empty;
That I change that convention ForTypesThatDeriveFrom<Order> to "Ship" ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---