netCoreSyncSetSyncIdInfo method

void netCoreSyncSetSyncIdInfo(
  1. SyncIdInfo value
)

Set the currently active SyncIdInfo.

Read more about this method in Client Side Initialization in the netcoresync_moor documentation for more details.

Implementation

void netCoreSyncSetSyncIdInfo(SyncIdInfo value) {
  if (!netCoreSyncInitialized) throw NetCoreSyncNotInitializedException();
  if (value.syncId.isEmpty) {
    throw NetCoreSyncException("SyncIdInfo.syncId cannot be empty");
  }
  if (value.linkedSyncIds.isNotEmpty && value.linkedSyncIds.contains("")) {
    throw NetCoreSyncException(
        "SyncIdInfo.linkedSyncIds should not contain empty string");
  }
  if (value.linkedSyncIds.isNotEmpty &&
      value.linkedSyncIds.contains(value.syncId)) {
    throw NetCoreSyncException(
        "SyncIdInfo.linkedSyncIds cannot contain the syncId itself");
  }
  dataAccess.syncIdInfo = value;
  dataAccess.activeSyncId = dataAccess.syncIdInfo!.syncId;
}