Vehicle as various subclasses (Car, Truck, ...)

In this query the tuple.Third will contain the discriminator of the Vehicle 
class. I want it to contain the class Type. NHibernate does have it 
(because it can create the correct classes), what I need is a type 
converter or a projection or something similar... Or perhaps it isn't 
possible? Thanks!

    NHibernate.Linq.Tuple<string, string, object> tuple = null;

    var res = s.QueryOver<Vehicle>()
        .SelectList(p => p
            .Select(q => q.Owner).WithAlias(() => tuple.First)
            .Select(q => q.Vin).WithAlias(() => tuple.Second)
            .Select(q => q.GetType()).WithAlias(() => tuple.Third)
)
        
.TransformUsing(Transformers.AliasToBean<NHibernate.Linq.Tuple<string, 
string, object>>())
        .List<NHibernate.Linq.Tuple<string, string, object>>();

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/0SEBOWH-GnkJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to