Help creating a ColumnName Convention using FluentNHibernate
Posted
by Rafael E. Belliard
on Stack Overflow
See other posts from Stack Overflow
or by Rafael E. Belliard
Published on 2010-05-14T02:36:25Z
Indexed on
2010/05/14
2:44 UTC
Read the original article
Hit count: 284
I've been trying to specify a custom naming convention for my database table columns. So far, I have been able to setup a convention for the table's name, but not the actual columns. I've seen a few guides on the internet, but they're not working using the latest Fluent NHibernate (1.0.0 RTM).
public class CamelCaseSplitNamingConvention : IClassConvention, IComponentConvention
{
public void Apply(IClassInstance instance)
{
instance.Table(instance.EntityType.Name.ChangeCamelCaseToUnderscore());
}
public void Apply(IComponentInstance instance)
{
// is this the correct call for columns? If not, which one?
}
}
Please help.
© Stack Overflow or respective owner