Is there a way to add criteria to a mapping for NHibernate?
public class Course {
public IList Participants { get; set; }
public IList&l
If you have subclasses of Participant with the status being the DiscriminatorValue, I think you can have them as separate lists since this way nHibernate knows how to differentiate them.
public class ParticipantMap : ClassMap
{
public ParticipantMap()
{
DiscriminateSubClassesOnColumn("Status");
}
}
public class ActiveParticipantMap : SubclassMap
{
public ActiveParticipantMap ()
{
DiscriminatorValue("Active");
}
}
// other subclasses of participant e.g. NonActive, etc.
public class Course {
public IList Participants {get;set;}
public IList ActiveParticipants {get;set;}
// any other lists of participant subclasses that you may have
}