Search code examples
breezebreeze-sharp

Breeze.Sharp nullable int , when set to zero on client, is being changed back to null on SaveChanges()


I'm using the 0.5.5.0 release of Breeze.Sharp, and one of my models has a Nullable<int> property.

The first time I save the model using SaveChanges(), this value is null as expected. If, however, I try changing the value to 0 later in the process, the saveBundle passed up the the breeze service still shows the value as null.

Just prior to calling SaveChanges() in the client, I can confirm that the value is 0 and that the client entity is in a modified state, but the value is immediately set back to null after calling SaveChanges().

When reviewing the saveBundle Json being sent to the service, I see my Nullable<int> property in the originalValuesMap set to null, however the property itself is not listed in the entity properties.

In my scenario, I am tracking win32 process history, which initially has a value of null for the process exit code while the process executes, and if it finishes successfully, is updated with 0.

Do I need to do anything special to get the 0 to be passed up to the server and recorded, or is this just a bug in the Breeze.Sharp library?


Solution

  • Ok, this was a bug and is fixed in version 0.5.9.0 ( or greater) available now in the GitHub repo as well as via nuget.