OData Null values
Null values are managed in a special fashion by our current OData provider, the Microsoft WCF Data Services Framework.
Microsoft WCF Data Services Client does not track entity changes at the property level which means the entire entity is sent from the client to the server during an update operation.
In situations where the entity was initially retrieved using projection (which is recommended due to performance), properties that were not retrieved will have a null value. During updates, the server cannot determine if the null value is the intended new value or the result of the property not being selected in the first place. As a result, the server will always treat null values as “not changed”.
Clearing property values
If you have to clear property values, you cannot set the property values to null as the null value will be interpreted as "No change". You must instead clear the property value.
To clear property values
- For string type properties: Send an empty string.
- For boolean type properties that can be set to Null: Cannot be set meaningfully to null. This is not an issue as the null value in a null-able boolean type means it has not been set – if you don't want to change the value, you should set the value to True or False,
- For DateTime property types can be set to Null: Sett the contents to DateTime zero in Utc (For example: someDateTimeProperty = new DateTime(0, DateTimeKind.Utc)).