Hi Anton,
That is the expected behavior. I'will try to explain:
- Right after you instantiate the entity, you set IsNew=false, so the framework now think this is a FETCHED entity.
- Next you set the nullable field to NULL. This field wont be marked as changed because from the framework point-of-view the entity is not new, so it compares the DBValue with CurrentValue and figure it out that there is nothing to change.
- You save the entity. As the nullable field wasn't marked as changed, it wont be updated.
To overcome this, set the IsNew = false just before the save action. This way, when you set the nullable field to NULL, the framework will treat the entity as new, thus the field will be marked as changed.
var entity = new TestEntity("PKKEYVALUE");
entity.NullableField = null;
entity.IsNew = false;
adapter.SaveEntity(entity);
This is documented somewhere here.