Exemple #1
0
 public void UpsertRecordInDatabase(IDatabaseTargetProvider databaseTargetProvider, DbRecord dbRecord, List <Object []> existingRecords)
 {
     if (!existingRecords.Any())
     {
         if (this.Configuration.ImportMode == DbTargetImportMode.Create || this.Configuration.ImportMode == DbTargetImportMode.All)
         {
             databaseTargetProvider.CreateRecordInDatabase(dbRecord);
         }
     }
     else
     {
         if (this.Configuration.ImportMode == DbTargetImportMode.Update || this.Configuration.ImportMode == DbTargetImportMode.All)
         {
             databaseTargetProvider.UpdateRecordInDatabase(dbRecord);
         }
     }
 }
Exemple #2
0
 private void UpsertRecordInDatabase(DbTargetImportMode importMode, DbRecord dbRecord, List <Object[]> existingRecords)
 {
     if (!existingRecords.Any())
     {
         if (importMode == DbTargetImportMode.Create || importMode == DbTargetImportMode.All)
         {
             databaseTargetProvider.CreateRecordInDatabase(dbRecord);
         }
     }
     else
     {
         if (importMode == DbTargetImportMode.Update || importMode == DbTargetImportMode.All)
         {
             databaseTargetProvider.UpdateRecordInDatabase(dbRecord);
         }
     }
 }