views:

428

answers:

1

Hi!

I want to create a convention for column names using Fluent NHibernate auto mapping. There is a blog entry that states that property conventions can be set like this:

ConventionBuilder.Property.When(
  x => x.Property.PropertyType == typeof(int),
  x => x.ColumnName(x.Property.Name + "Num")
)

But the problem is, that x only has a ColumnNames property and has no ColumnName method. How can I change the property mapping conventions using the new style configuration?

(P.S: I'm using the latest binary avaialable on the site as of today)

+1  A: 

Okay... it seems they changed from the ColumnName property to a ColumnNames list. You have to add your columnname to this list like this:

ConventionBuilder.Property.Always(s => s.ColumnNames.Add(s.Property.Name + "Num"))
SztupY