20 lines
568 B
C#
20 lines
568 B
C#
|
using FluentNHibernate.Conventions;
|
|||
|
using FluentNHibernate.Conventions.Instances;
|
|||
|
using System.Diagnostics;
|
|||
|
|
|||
|
namespace Tanshu.Accounts.SqlDAO
|
|||
|
{
|
|||
|
public class InverseConvention : IHasManyConvention //, IReferenceConvention
|
|||
|
{
|
|||
|
public void Apply(IOneToManyCollectionInstance instance)
|
|||
|
{
|
|||
|
var property = instance.Member;
|
|||
|
if (!AttributeChecker.Inverse(property)) return;
|
|||
|
Trace.TraceInformation("Inverse on {0}.{1}", property.DeclaringType.Name, property.Name);
|
|||
|
instance.Inverse();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|