From c065dc987fbca8b2f167e8067dcdce09b5b01d75 Mon Sep 17 00:00:00 2001 From: Matthias Sebastian Sort Date: Mon, 7 Apr 2025 10:12:54 +0200 Subject: [PATCH] Added check and call to JobSchemaService when SchemaManagementFeature is active instead of calling GetOriginalDestinationSchema. --- ...web.DataIntegration.Providers.ODataProvider.csproj | 2 +- src/ODataWriter.cs | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj index cbd7191..29bd6c6 100644 --- a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj @@ -1,6 +1,6 @@  - 10.8.9 + 10.8.10 1.0.0.0 OData Provider The Odata Provider lets you fetch and map data from or to any OData endpoint. diff --git a/src/ODataWriter.cs b/src/ODataWriter.cs index fee0da7..b86a685 100644 --- a/src/ODataWriter.cs +++ b/src/ODataWriter.cs @@ -2,6 +2,7 @@ using Dynamicweb.DataIntegration.EndpointManagement; using Dynamicweb.DataIntegration.Integration; using Dynamicweb.DataIntegration.Integration.Interfaces; +using Dynamicweb.DataIntegration.ProviderHelpers; using Dynamicweb.DataIntegration.Providers.ODataProvider.Model; using Dynamicweb.Ecommerce; using Dynamicweb.Ecommerce.Orders; @@ -39,7 +40,15 @@ internal ODataWriter(ILogger logger, Mapping mapping, Endpoint endpoint, ICreden Credentials = credentials; Mapping = mapping; EndpointAuthenticationService = new EndpointAuthenticationService(); - var originalDestinationTables = Mapping.Destination.GetOriginalDestinationSchema().GetTables(); + TableCollection originalDestinationTables; + if (Feature.IsActive()) + { + originalDestinationTables = JobSchemaService.GetSchema(Mapping.Destination).GetTables(); + } + else + { + originalDestinationTables = Mapping.Destination.GetOriginalDestinationSchema().GetTables(); + } var originalDestinationMappingTable = originalDestinationTables.FirstOrDefault(obj => obj.Name == Mapping.DestinationTable.Name); _destinationPrimaryKeyColumns = originalDestinationMappingTable?.Columns.Where(obj => obj.IsPrimaryKey)?.ToDictionary(obj => obj.Name, obj => obj.Type) ?? new Dictionary(); _responseMappings = Mapping.GetResponseColumnMappings();