Hi,

 

I have simple mapping of a class with an aggregated component. Lets call the 
class ‘Person’ and the component class ‘Address’. 

 

I would like to know if its possible to enforce a naming convention for the 
column names of the component where the column names are ‘scoped‘ by the name 
of property used to access the component. 

 

That is I would rather write (and get the column names as described in the more 
verbose example)

 

public class PersonMap : ClassMap<Person>

{

                                            PersonMap()

                                            {

                                                                 Component(x => 
x.HomeAddress, c =>

                                                                                
       {

                                                                                
                             c.Map(x => x.Street);

                                                                                
                             c.Map(x => x.PostalCode);

                                                                                
                             // etc...

                                                                                
       });

                      }

}

 

Instead of the more verbose

 

public class PersonMap : ClassMap<Person>

{

                                            PersonMap()

                                            {

                                                                 Component(x => 
x.HomeAddress, c =>

                                                                                
       {

                                                                                
                             c.Map(x => x.Street, "HomeAddress_Street");

                                                                                
                             c.Map(x => x.PostalCode, "HomeAddress_PostalCode");

                                                                                
                             // etc...

                                                                                
       });

                      }

}

 

Kind regards

Maxild

 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to