I'm using .Net framework 2.0 and v2.6 of LLBLGen.
I have a Bill table in a one-to-many relation with LineItem table, and I'm attempting to retrieve EntityCollection<BillEntity> where the
sum of the related LineItem.Amount exceeds 100.
The sql would be
select * from Bill
where (select sum(Amount) from LineItem where Bill.BillId = LineItem.BillId) > 100
Here's what I have (not working, of course)
RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.Relations.Add(BillEntity.Relations.LineItemEntityUsingBillId);
bucket.PredicateExpression.Add(new PredicateExpression(LineItemFields.Amount.SetAggregateFunction(AggregateFunction.Sum) > 100));
Any guidance on this is greatly appreciated.