In the attached code snippet I have a for each loop on a linq result set.
Each loop updates a LocalPrice field and then calls CalculateRowTotals which is a routine in the partial class of the order details linq entity.
CalculateRowTotal simply updates the totals in the row based on the new LocalPrice.
For some reason CalculateRowTotals does not write the totals back to the database... the LocalPrice is changed without issue... whats going on?
'Do we have a current order
Dim ordHead = (From p In db.bb_order_headers
Where p.AccountNo_FK = c.AccountNo And p.OrderStatus = "N").SingleOrDefault
If Not (ordHead Is Nothing) Then
Dim ordDetails = From p In db.bb_order_details
Where p.OrderHeaderId_FK = ordHead.OrderHeaderId
For Each rec As bb_order_detail In ordDetails
'For some reason
rec.LocalPriceDB = c.GetLocalCurrencyPrice(rec.Price)