public
Description: Fluent NHibernate!
Homepage: http://fluentnhibernate.org
Clone URL: git://github.com/jagregory/fluent-nhibernate.git
fluent-nhibernate / src / FluentNHibernate / Conventions / Helpers / Prebuilt / BuiltForeignKeyConvention.cs
100644 19 lines (17 sloc) 0.621 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using FluentNHibernate.Mapping;
 
namespace FluentNHibernate.Conventions.Helpers.Prebuilt
{
    public abstract class BuiltForeignKeyConvention : ForeignKeyConvention, IRelationshipConvention
    {
        public bool Accept(IRelationship target)
        {
            return true;
        }
 
        public void Apply(IRelationship target)
        {
            if (target is IOneToManyPart) base.Apply((IOneToManyPart)target);
            if (target is IManyToManyPart) base.Apply((IManyToManyPart)target);
            if (target is IManyToOnePart) base.Apply((IManyToOnePart)target);
        }
    }
}