version 1.0.2005.1 final (self-servicing)
VS2005 winforms
hiya,
I have an entityCollection that contains the following fields.
deliveryId PK
barcode FK
qty
productName....a field mapped onto tblProduct.productName.
the other relevant database table is:
tblProduct
barCode PK
productName
unitPrice
I want to grab the SUM total of the delivery.
My problem is that "unitPrice" is NOT in the entityCollection.
I'm not sure what I should do?
Can anyone help?
many thanks,
yogi
TblDeliveryProductsCollection deliveries = new TblDeliveryProductsCollection();
//yogi: how do I tie the TblDeliveryProductsFields.Qty WITH TblProductFields.UnitPrice??
IExpression DeliveryTotalExpression = new Expression(TblDeliveryProductsFields.Qty, ExOp.Mul, TblProductFields.UNITPRICE);
IPredicate filter = PredicateFactory.CompareValue(TblDeliveryProductsFieldIndex.DeliveryId, ComparisonOperator.Equal, 0);
object deliveryTotal = deliveries.GetScalar(TblDeliveryProductsFieldIndex.DeliveryId, DeliveryTotalExpression, AggregateFunction.Sum, filter);