I have 3 classes that I’m trying to map using fluent nHibernate, but I’ve hit a wall. I have a collection in class A that refers to class B, B also has a reference to A. So that is a Many-to-one relationship. My problem is that A also has a reference to C (which extends B), and because it already has a reference to A (through B) I don’t want to have to create a new property to make the one-to-many relationship between A and C. Is this possible or do I have to make a second property in C?
public class A
{
public virtual IList<B> AllBInstances { get; set; }
public virtual C ActiveC { get; set; }
}
public class B
{
public virtual A Parent { get; set; }
}
public class C : B
{}
for the given example here are the mappings
which would give you