diff --git a/src/Dynamicweb.DataIntegration.Providers.DynamicwebProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.DynamicwebProvider.csproj index 181563e..9e2dfa4 100644 --- a/src/Dynamicweb.DataIntegration.Providers.DynamicwebProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.DynamicwebProvider.csproj @@ -1,6 +1,6 @@  - 10.7.0 + 10.8.0 1.0.0.0 Dynamicweb Provider Dynamicweb Provider @@ -23,8 +23,8 @@ snupkg - - + + diff --git a/src/DynamicwebProvider.cs b/src/DynamicwebProvider.cs index 5de05e7..00465cf 100644 --- a/src/DynamicwebProvider.cs +++ b/src/DynamicwebProvider.cs @@ -437,24 +437,6 @@ public override void OverwriteDestinationSchemaToOriginal() Schema = GetOriginalSourceSchema(); } - private static IEnumerable ReplaceKeyColumnsWithAutoIdIfExists(Mapping mapping) - { - //will move this to MappingExtensions - US https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/20900 - if (mapping == null) return []; - - var autoIdDestinationColumnName = MappingExtensions.GetAutoIdColumnName(mapping.DestinationTable?.Name ?? ""); - if (string.IsNullOrEmpty(autoIdDestinationColumnName)) return mapping.GetColumnMappings(); - - var columnMappings = mapping.GetColumnMappings().ToList(); - var autoIdColumnMapping = columnMappings.Where(obj => obj.DestinationColumn.Name.Equals(autoIdDestinationColumnName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); - if (autoIdColumnMapping != null) - { - columnMappings.ForEach(obj => obj.IsKey = false); - autoIdColumnMapping.IsKey = true; - } - return columnMappings; - } - public override bool RunJob(Job job) { if (IsFirstJobRun) @@ -475,7 +457,7 @@ public override bool RunJob(Job job) { if (mapping.Active) { - var columnMappings = ReplaceKeyColumnsWithAutoIdIfExists(mapping); + var columnMappings = MappingExtensions.ReplaceKeyColumnsWithAutoIdIfExists(mapping); Logger.Log("Starting import to temporary table for " + mapping.DestinationTable.Name + "."); using (var reader = job.Source.GetReader(mapping)) {