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

17 lines
411 B
C#
Raw Normal View History

using System;
using FluentNHibernate.Conventions;
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";
}
}
}