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

28 lines
711 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Tanshu.Data.DAO;
using FluentNHibernate.Automapping;
using FluentNHibernate;
namespace Tanshu.Accounts.SqlDAO
{
public class StoreConfiguration : DefaultAutomappingConfiguration
{
public override bool ShouldMap(Type type)
{
return type.Namespace.StartsWith("Tanshu.Accounts.Entities");
}
public override bool IsId(Member member)
{
string key = member.DeclaringType.Name + "ID";
return key == member.Name;
}
public override bool IsDiscriminated(Type type)
{
return true;
}
}
}