Print Page | Close Window

How to set EntityAspect to IsChanged=false

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3769
Printed Date: 11-Apr-2026 at 4:34am


Topic: How to set EntityAspect to IsChanged=false
Posted By: gregweb
Subject: How to set EntityAspect to IsChanged=false
Date 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



Replies:
Posted By: sbelini
Date 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.


Posted By: gregweb
Date Posted: 06-Nov-2012 at 4:37pm
OK, thanks for the info.

greg



Print Page | Close Window