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>>();