How to transform an entity into composite dto? (Fluent Nhibernate)
I was exploring Nhibernate and have come across a problem.
I have the following Entities.
And the corresponding Dto for them
Now using the following query I am trying transform the Orders into Orderdto
select o
FROM Order o
join o.OrderItems
join o.Customer
The following transformation is not working probably because of Order being a composite type.
var query = session.GetNamedQuery("GetOrderSummaries")
.SetResultTransformer(Transformers.AliasToBean<OrderItemDto>());
Any out of box transformation available for s开发者_Go百科uch situations?
Personally I would use AutoMapper for this, rather than doing it in Nhibernate/Fluent (whether or not it was possible).
精彩评论