Linq Aggregate on object and List
- by Kris-I
I do this query with NHibernate:
var test = _session.CreateCriteria(typeof(Estimation))
.SetFetchMode("EstimationItems", FetchMode.Eager)
.List();
An "Estimation" can have several "EstimationItems" (Quantity, Price and ProductId)
I'd like a list of "Estimation" with these constraints :
One line by "Estimation" code on the picture (ex : 2011/0001 and 2011/0003)
By estimation (means on each line) the number of "EstimationItems"
By Estimation (means on each line) the total price (Quantity * Price) for each "EstimationItems"
I hope the structure will be clearer with the picture below.
Thanks,