narsil/Tanshu.Accounts.SqlDAO/Fluent/ForeignKeyConvention.cs

18 lines
436 B
C#
Raw Normal View History

using System;
using FluentNHibernate.Conventions;
using System.Reflection;
using FluentNHibernate;
namespace Tanshu.Accounts.Conventions
{
public class CustomForeignKeyConvention : ForeignKeyConvention
{
protected override string GetKeyName(Member property, Type type)
{
return property == null
? type.Name + "ID"
: property.Name + "ID";
}
}
}