New Posts New Posts RSS Feed: How to set EntityAspect to IsChanged=false
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How to set EntityAspect to IsChanged=false

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: How to set EntityAspect to IsChanged=false
    Posted: 06-Nov-2012 at 2:01pm
Is it possible to reset EntityAspect.IsChanged to false?

Here is the scenario:

A default entity is created with default data. At this point I would like to set IsChanged to false. It is then displayed to the user. If the user then changes a property, then IsChanged should be set to true and it can then be saved as usual.

The point being that I don't want to save default data to the database.



Greg
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 06-Nov-2012 at 3:59pm
Hi Greg,
 
The only way to set IsChanged to false is setting EntityState to Unchanged.
In your case, this might be problematic because once the user update the entity, it's EntityState will change to Modified (rather then Added) and you would have to handle it.
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 06-Nov-2012 at 4:37pm
OK, thanks for the info.

greg
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down