views:

199

answers:

1

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  A: 

The Fluent NHibernate wiki has a section on ignoring base types when automapping that might be worth reading.

James Gregory
If you skip the intermediate subclass with IgnoreBase as the wiki article suggests, then believes class `C` is an independent class unrelated to `A`.
David Pfeffer
Ah, bummer. That'll be a bug then. I've created an issue for you to track: http://fluentnhibernate.lighthouseapp.com/projects/33236-core/tickets/128-skip-intermediary-classes-when-automapping-subclasses.
James Gregory
Oh, cool. I just assumed that was a desired feature.
David Pfeffer