This is my code which trying to merge edit change to the parent version. The reconcileResult indicates there is no confict, howerver the change did not goes to the parent version. Have i missed something?
var childVersion = versionManager.GetVersion(draftingVersion);
var parentVersion = childVersion.GetParent();// versionManager.GetVersion(upperVersion);
var reconcileOptions = new ReconcileOptions(parentVersion)
{
ConflictDetectionType = ConflictDetectionType.ByRow,
ConflictResolutionMethod = ConflictResolutionMethod.Continue,
ConflictResolutionType = ConflictResolutionType.FavorEditVersion,
};
// Perform reconcile
// var reconcileResult = childVersion.Reconcile(reconcileOptions);
PostOptions postOptions = new PostOptions(parentVersion);
postOptions.ServiceSynchronizationType = ServiceSynchronizationType.Synchronous;
ReconcileResult reconcileResult = childVersion.Reconcile(reconcileOptions, postOptions);
The code snippet looks good to me. You could use the Fiddler tool to check if your request reached the server.
Also, for debugging purposes, you can split Reconcile and Post into two parts -
// Create a ReconcileOptions object
ReconcileOptions reconcileOptions = new ReconcileOptions(parentVersion);
reconcileOptions.ConflictResolutionMethod = ConflictResolutionMethod.Continue; // continue if conflicts are found
reconcileOptions.ConflictDetectionType = ConflictDetectionType.ByRow;
reconcileOptions.ConflictResolutionType = ConflictResolutionType.FavorEditVersion
// Reconcile
ReconcileResult reconcileResult = currentVersion.Reconcile(reconcileOptions);
if (!reconcileResult.HasConflicts)
{
//No conflicts, perform the post
PostOptions postOptions = new PostOptions(parentVersion);
postOptions.ServiceSynchronizationType = ServiceSynchronizationType.Synchronous;
currentVersion.Post(postOptions);
}
Are you building a corehost application using traditional versioning?
No, I am just building a normal Add-in.
reconcileOptions.ConflictDetectionType = ConflictDetectionType.ByColumn;
by changing this, it works now. But I don't know why.
You probably changed the same column in the same row at different versions
Please refer to https://learn.microsoft.com/en-us/sql/relational-databases/replication/merge/advanced-merge-replicat... for conflict detection concepts.