The best way is the way that you've done it, with the GetComponentColumnPrefix; however, you've obviously highlighted a flaw in our design that needs to be fixed.
On Wed, Feb 3, 2010 at 5:04 PM, Martin From <[email protected]> wrote: > I am try to write a Component Convention soo that every Property in a > component gets mapped to a column of etc. Component/Class Name + "-" + > Property name ("MyComponent-Address"). > > I currently have the following code > > public class ComponentConvention : IComponentConvention > { > public void Apply(IComponentInstance instance) > { > foreach (var property in instance.Properties) > { > string columnName = String.Format("{0}-{1}", > instance.EntityType.Name, property.Name); > // property.Column(columnName) <- How can it be done > !?!??!! > } > } > } > > The problem seems that instance.Properties returns IPropertyInspector > and not IPropertyInstance so i can call the property.Column() method. > > How can i set the column name for each property ? > > > > Martin > > > ps. right now i have only got it working by using > GetComponentColumnPrefix when creating the AutoPersistenceModel > object. > > -- > 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]<fluent-nhibernate%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/fluent-nhibernate?hl=en. > > -- 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.
