NHibernate: discriminator without common base class?
- by joniba
Is it possible to map two classes to the same property without them sharing a common base class?
For example, a situation like this:
class Rule
{
public virtual int SequenceNumber { get; set; }
public virtual ICondition Condition { get; set; }
}
interface ICondition
{
}
class ExpressionCondition : ICondition
{
public virtual string Expression { get; set; }
}
class ThresholdCondition : ICondition
{
public virtual int Threshold { get; set; }
}
I also cannot add some empty abstract class that both conditions inherit from because the two ICondition implementations exist in different domains that are not allowed to reference each other. (Please no responses telling me that this situation should not occur in the first place - I'm aware of it and it doesn't help me.)