Does Hibernate + NhibernateLINQ support projection of inner objects.
for eg. when I try the following I get an Index out of bounds exception on Patient object on the call to Queryable.ToList()
var registrations = from r in _session.Linq<Domain.Registration>().Expand("Patient") select r;
var queryable = registrations.Select(
r => new { r.Id, r.AccountNumber, r.DateAdded, r.DateUpdated, r.Patient.FamilyName, r.Patient});
var list = queryable.ToList();
var workListItems = new List<WorkListItem>();
foreach (var anonymous in list)
{
var w = new WorkListItem
{
Id = anonymous.Id,
ClientAccountId = anonymous.AccountNumber,
DateAdded = anonymous.DateAdded,
DateUpdated = anonymous.DateUpdated,
Patient = anonymous.Patient
};
workListItems.Add(w);
}
return workListItems;