Chuck Boyde
unread,May 14, 2012, 1:20:34 AM5/14/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
Have a scenario where I need to only select a few properties from an
entity, but also collections. This seems such a normal situation, yet
cannot find info on projecting collections - only properties.
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>();
Error returned is:
System.IndexOutOfRangeException : Index was outside the bounds of the
array