When projecting a discriminator column into a DTO using QueryOver I
can do the following:-
return Session
.QueryOver<Product>()
.SelectList(i => i
.Select(p => p.Name).WithAlias(() => dto.Name)
.Select(p => p.GetType()).WithAlias(() => dto.ProductType)
)
.TransformUsing(Transformers.AliasToBean<ProductDto>())
.List<ProductDto>();
However when using Linq I can't seem to get the discriminator value
only the derived class name.
return (from product in Session.Query<Product>()
select new ProductDto{
Name = product.Name,
ProductType = product.GetType().Name
}).ToList();
Here GetType().Name returns the derived class name (as one would
expect), how do I get the discriminator value using Linq?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
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.