2
我一直在試圖爲我的數據庫表列指定一個自定義的命名約定。到目前爲止,我已經能夠爲表格名稱設置約定,但不能設置實際的列。我在網上看過一些指南,但他們沒有使用最新的Fluent NHibernate(1.0.0 RTM)。幫助使用FluentNHibernate創建ColumnName約定
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?
}
}
請幫忙。
感謝。它工作完美。 :) – rebelliard 2010-05-14 12:17:00