1
votes

I'm using the Fluent NHibernate mapper with table-per-subclass to map the following structure:

public abstract class A
{
    // properties here
}

public abstract class B : A
{
    // methods here
}

public class C : B
{
    // properties here
}

My database only has tables to represent class A and class C. Class B exists only in my model for my convenience and doesn't contain any properties that needs to be mapped.

How can I get the automapper to skip B and map C as a subclass of A?

1
Seeing your mapping overrides or manual class maps would be helpful. Also, can you post your initialization where you have the IncludeBase<A> code? - Chris F
I'm using the automapper and I don't have any manual maps or overrides at the moment. - David Pfeffer
FYI, the issue I opened relating to your question has now been resolved. The only thing you need to be aware of for this particular situation is that abstract classes are deemed layer supertypes by default, so your A class wouldn't get mapped unless you used IncludeBase<A> explicitly or overrode the AbstractClassIsLayerSupertype configuration method to exclude that class. - James Gregory
Thanks! Glad for the follow up. - David Pfeffer

1 Answers

2
votes