I get my object from the database using my repo like this:
Public Shared Function GetOrderFulfillment(ByVal OrderNumber As Integer) As OrderFulfillment
Dim objCustomerOrder = DB.Select().From(Tables.OrderFulfillment).Where(Columns.OrderNumber).IsEqualTo(OrderNumber).ExecuteSingle(Of OrderFulfillment)()
objCustomerOrder.MarkOld()
Return objCustomerOrder
End Function
Change some values and save it back:
orderFulfillment.OrderTotal = newOrderTotal + netShipping + netTax
orderFulfillment.TotalShippingCost = netShipping
orderFulfillment.Tax = netTax
orderFulfillment.AutoShipDiscount = order.AutoShipDiscount * -1
orderFulfillment.Shipping = totalShipping
orderFulfillment.RefundAmount = totalRefundAmount
orderFulfillment.ActualShippingCost = ActualCost
orderFulfillment.HandlingFee = HandlingFee
orderFulfillment.Save("AutomatedUpdateOrderStatus")
This generates the following SQL that fails for obvious reasons:
exec sp_executesql N'UPDATE [ultrawellness].[OrderFulfillment] SET WHERE [OrderFulfillmentID] = @OrderFulfillmentID; SELECT @OrderFulfillmentID AS id',N'@OrderFulfillmentID int',@OrderFulfillmentID=7055
Where in the world are my SET values at? I have used this same pattern a millinon times - why is it chocking on this one?
FYI on the object that I apply the save to the following is set: .IsDirty = True .DirtyColumns = 0
I think DirtyColumns should not be 0 since I updated a bunch of them but that is just a guess?
Anyone?