DoReplaceMerge Extension Method

Overview

Replaces the current data in the observable data set with the refreshed data set.

Declaration

/// <summary>
/// Refreshes the observable data set by replacing its content with the content of the refreshed data set /// </summary>
/// <param name="observableDataSet">Observable data set</param>
/// <param name="refreshedDataSet">Refreshed data set</param>
/// <param name="observableMergeOptions">Observable merge options</param>
public static void DoReplaceMerge(this IObservableDataSet? observableDataSet, IDataSet refreshedDataSet, IObservableMergeOptions observableMergeOptions)

Namespace and Assembly

Namespace: PocoDataSet.ObservableExtensions
Assembly: PocoDataSet.ObservableExtensions.dll

Usage Example

// 1. Assuming observable data set is used for UI binding
IObservableDataSet boundObservableDataSet = new ObservableDataSet();

// The following line is a pseudo-code example of how UI can be bound to the observable data set.
// The actual binding code depends on the UI framework and is not part of POCO DataSet.
somePage.DataContext = boundObservableDataSet;

// 2. User chooses "Reload" to discard local changes and re-sync with server
// Say, you got the response from the server as IDataSet into latestSnapshotFromServer variable:
IDataSet latestSnapshotFromServer = ...

// 3. Call DoReplaceMerge method to refresh the UI with the latest snapshot from the server.
// Itr replaces the entire UI baseline with the server snapshot, discarding all local changes.
IObservableMergeOptions options = new ObservableMergeOptions();
uiDataSet.DoReplaceMerge(fullSnapshotFromServer, options);

 

Table of Content POCO DataSet Observable Data Set Members

 


Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Code examples are provided under the MIT License.
You are free to share and adapt the material provided that appropriate credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness or suitability of the information and are not responsible for any damages resulting from its use.