It doesn't, but it's quite easy to make it work.

In AutoMapper source code in method MapInheritanceTree, just before if
(!isDiscriminated) add

var tempMapping = mapping as ClassMapping;
if(tempMapping != null && tempMapping.IsUnionSubclass)
{
    subclassMapping = new SubclassMapping(SubclassType.UnionSubclass)
    {
        Type = inheritedClass.Type
    };
}
else if

it will generate union-subclasses mappings, you can test it with:

[TestFixture]
public class UnionSubclassConventionTests
{
    [Test]
    public void DefaultConventionsAreAppliedToUnionSubClasses()
    {
        new AutoMappingTester<SuperType>(
            AutoMap.AssemblyOf<SuperType>()
                .Where(x => x.Namespace ==
typeof(SuperType).Namespace)
                .Override<SuperType>(m =>
m.UseUnionSubclassForInheritanceMapping()))
            .Element("class/union-subclass").Exists();
    }
}

not sure if more tests should be written.

Cheers,
   Jakub G

On May 3, 2:45 pm, lbargaoanu <lbargao...@gmail.com> wrote:
> Does UseUnionSubclassForInheritanceMapping work with the AutoMapper?
> Because I use an override and call it and I still get JoinedSubclass.

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to