Reputation: 10546
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)
Upvotes: 1
Views: 1779
Reputation: 10546
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"))
Upvotes: 1