NHibernate预测 - 如何预测集合

Sam*_*l G 5 nhibernate

有一个场景,我只需从实体中选择一个/几个列,但在查询中只有多个子项.我一直在尝试使用投影,但在collections属性上遇到错误.这是一种正常情况,但无法找到有关投影集合的信息 - 仅限属性.

Customer customerAlias = null;
Order orderAlias = null;
 var list = _session.QueryOver<Customer>(() => customerAlias)
                    .JoinAlias(x => x.Orders, () => orderAlias, JoinType.LeftOuterJoin)
                    .Select(
                       Projections.Property(() => customerAlias.Name),
                       Projections.Property(() => customerAlias.Orders))//this is the issue
                   .List<object>();
Run Code Online (Sandbox Code Playgroud)

返回的错误是:

System.IndexOutOfRangeException : Index was outside the bounds of the array
Run Code Online (Sandbox Code Playgroud)