Datacontext submitchanges not updating
I am having an issue with the Submit Changes function provided by the linq to DB implementation in C#.When I run the command, nothing throws an error but the record never gets updated.After hours of head scratching I noticed that my Set method was updating the private member not the public property, i.e.this._Walking = value; All I had to do was change this to this.
If I try to set the value of the column to ZERO, the Submit Changes does not update the column. My problem was being caused by the fact when I created my entity to attach, the default value of the column was set to zero, so when it tried to assign the value to zero ... LINQ to SQL ignores updates to the current value, so if the field was already zero, you may not see any updates. just to make it work is the following: I thought this would load the original values ... So when it updates the properties it sees the Units already as 0 and it sets it to zero. I have found it useful to use the Log property of the Data Context to see the SQL being generated.