Example #1
0
        private async Task <UpsertResult[]> SynchToSfdc(SyncTask task)
        {
            SqlConnectionParameter  sqlConnection  = Helper.GetSqlConnection(_job.Connections, task.SourceConnection);
            SfdcConnectionParameter sfdcConnection = Helper.GetSfdcConnection(_job.Connections, task.TargetConnection);
            SfdcCommand             command        = Helper.GetSfdcCommand(task.TargetCommand.ToString());

            _sfdcAdapter.ConnectionParameter = sfdcConnection;
            _sfdcAdapter.Command             = command;
            _sfdcAdapter.Map = task.Mapping;

            _sqlAdapter.ConnectionParameter = sqlConnection;

            UpsertResult[] results = await _sqlAdapter.SyncAsync(task.SourceCommand.ToString(), _sfdcAdapter.UpsertAsync);

            return(results);
        }