Hi guys,
I've just started using NH last week, and I love it already! The first real problem I've faced is around custom collections. NH returns an IList of persisted entities, but in one situation I need an IList of fields from multiple tables. Since I need this list for read-only reporting function, it doesn't need lazy loading or persistence etc.
Eg:
select p.Name, 'Cash', p.Vehicle.Model from Person as p
The above query will return an IList of objects. Is there a simple way to have it return an IList collection of a custom class (say MemberList, with properties: Name, ModeOfPayment, VehicleModel)?
Maybe this is trivial, but I'm new to NH and still learning the tricks.
Thanks!
|