Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.8.9</Version>
<Version>10.8.10</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>OData Provider</Title>
<Description>The Odata Provider lets you fetch and map data from or to any OData endpoint.</Description>
Expand Down
11 changes: 10 additions & 1 deletion src/ODataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<SchemaManagementFeature>())
{
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<string, Type>();
_responseMappings = Mapping.GetResponseColumnMappings();
Expand Down
Loading