Single entity can be checked for changes using HasChanged method, but there is also a possibility to check if there are any changes on a session or even what has changed. Both HasChanges
property and WhatChanged
method are available in Advanced
session operations.
{PANEL:HasChanges}
Property indicates if session contains any changes. That is if there are any new, changed or deleted entities.
{CODE what_changed_1@ClientApi\Session\HowTo\WhatChanged.cs /}
{CODE what_changed_2@ClientApi\Session\HowTo\WhatChanged.cs /}
{PANEL/}
{PANEL:WhatChanged}
Method returns all changes for each entity stored within session. Including name of the field/property that changed, its old and new value and change type.
{CODE what_changed_3@ClientApi\Session\HowTo\WhatChanged.cs /}
ReturnValue | |
---|---|
IDictionary<string, DocumentsChanges[]> | Dictionary containing list of changes per document key. |
{CODE what_changed_4@ClientApi\Session\HowTo\WhatChanged.cs /}
{CODE what_changed_5@ClientApi\Session\HowTo\WhatChanged.cs /}
{PANEL/}