New Posts New Posts RSS Feed: Persistence Manager - HasChanges
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Persistence Manager - HasChanges

 Post Reply Post Reply
Author
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Topic: Persistence Manager - HasChanges
    Posted: 12-Jul-2007 at 4:48pm
     (1)                 You can get the specific entities by asking for all entities that have a DataRowState of Added, Deleted, or Modified.  For example, you can get all Employees with changes with this one line of code.

                  mEmployees = mPM.GetEntities<Employee>

                      (DataRowState.Added | DataRowState.Deleted | DataRowState.Modified);;

(2)                 You can tell which columns have changed by comparing the CurrentVersion of the object with the OriginalVersion.  Here is how you can get the Current and Original FirstName of an Employee:

                    Employee aEmployee = mEmployees[0];

                    String currentFirstName = (String)aEmployee["FirstName", DataRowVersion.Current];

                    String originalFirstName = (String)aEmployee["FirstName", DataRowVersion.Original];

 

Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 4:46pm

When the PersistenceManager.HasChanges is true,

1)       Can the PM tell me which entities it thinks has changes?

2)       For a specific entity which “HasChanges”, can the PM tell me which columns it thinks has changed?

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down