I have the following code,
PB.ForEach(Function(x) x.Cost = GetPartCost(x.PartNumber, x.Units, x.Cost, FB))
Return PB.Sum(Function(x) (x.Cost * x.Qty))
However it always returns 0. I've checked and the GetPartCost
function executes and returns a non-zero number but the list item cost properties are never updated.
The property is just a simple property,
Public Property Cost() As Double
Get
Return _Cost
End Get
Set(ByVal value As Double)
_Cost = value
End Set
End Property
If I set a breakpoint in the Set
of the property, it never gets hit.
What is going on with this?