IsDirty

Posts   
 
    
Pablo
User
Posts: 81
Joined: 21-Mar-2005
# 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 avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# 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
Posts: 81
Joined: 21-Mar-2005
# Posted on: 16-Jun-2008 11:11:24   

Walla,

I see, and agree!

thank you again for your quick response and insight!!

Paul