views:

24

answers:

0

Is it possible to create a simple convention to modify the polymorphism mode of a class, if there is a joined-subclass ?

Doing this :

public class EntityMap : ClassMap<EntityBase>
{
    public EntityMap()
    {
        Polymorphism.Explicit();
    }
}

but inside a convention. Using IClassConvention doesn't work, as the Polymorphism property is read only :

public class TestConvention : IClassConvention
{
    public void Apply(IClassInstance instance)
    {
        // read only property !
        instance.Polymorphism = Polymorphism.Explicit;
    }
}

related questions