narsil/Tanshu.Accounts.Repository/Fluent/StoreConfiguration.cs
2011-03-12 17:12:02 +05:30

38 lines
1.1 KiB
C#

using System;
using FluentNHibernate;
using FluentNHibernate.Automapping;
namespace Tanshu.Accounts.Repository
{
public class StoreConfiguration : DefaultAutomappingConfiguration
{
public override bool ShouldMap(Type type)
{
bool val = type.Namespace.StartsWith("Tanshu.Accounts.Entities");
if (type.IsEnum)
val = false;
return val;
}
public override bool IsId(Member member)
{
string key = member.DeclaringType.Name + "ID";
return key == member.Name;
}
public override bool IsDiscriminated(Type type)
{
return true;
}
public override string SimpleTypeCollectionValueColumn(Member member)
{
return base.SimpleTypeCollectionValueColumn(member);
}
public override bool ShouldMap(Member member)
{
//if (AttributeChecker.Formula(member.MemberInfo))
// return false;
//else
return base.ShouldMap(member);
}
}
}