Forum:  Bugs & Issues

Thread:  IsDirty


Pablo (User)   Posted on: 16-Jun-2008 10:04:16.
Hello,

I ran into unexpected behavior.

Scenario 1:

CustomerEntity customer = new CustomerEntity();
customer.Name = "John";

This results in customer.IsDirty == true! Which I believe is correct. In this case save() actually produces a row in the database.


However, with scenario 2:

CustomerEntity customer = new CustomerEntity();
customer.Fields["Name"].CurrentValue = "John";

Results in: customer.IsDirty == false. In this case save() does not produce anything.

Is this strange or not??? I explicitly set the IsDirty property to true in my scenario 2 in order to be able to save, but I thought I mention it as I expect it to be a bug.

Paul


Walaa (Support Team)   Posted on: 16-Jun-2008 10:24:14.
This is not a bug, you shouldn't set the CurrentValue directly.
Or else you'd have to take care of the plumbing.


Pablo (User)   Posted on: 16-Jun-2008 11:11:24.
Walla,

I see, and agree!

thank you again for your quick response and insight!!

Paul