NHibernate Collection Sub Query

后端 未结 3 1306
半阙折子戏
半阙折子戏 2021-01-21 14:51

Is there a way to add criteria to a mapping for NHibernate?

public class Course {
   public IList Participants { get; set; }
   public IList&l         


        
3条回答
  •  暖寄归人
    2021-01-21 15:11

    You dont need a subquery to load a collection with additional condition.

    HasMany(x => x.ActiveParticipants).Where("Status = 'Active'");
    

提交回复
热议问题