Woops... Third is the discriminator-value, not some internal id. Just found (I was using some classes from the nhibernate-tests). The questions are still good.
Il giorno giovedì 8 novembre 2012 12:17:09 UTC+1, xanatos ha scritto: > > I have some classes subclassing Vehicle, let's say Car, Truck, ... They > are correctly mapped in nhibernate. > I want to do a projection using SelectList. I want to project the class > type. If I do something like what I've written below I'll get as Third an > integer. I'll say that it's the internal identifier of the class used by > nhibernate. > > 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<Tuple<string, string, object>>()) > .List<Tuple<string, string, object>>(); > > (note that I'm using C# 3.5, so the Tuple is NHibernate.Tuple) > > What I want (choose one) > > A) Get a Type object in the Tuple instead of an integer > > or > > B) convert the integer to a Type > > Thanks > -- 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/-/TG3Iort49b0J. 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.
