Skip to content

Commit

Permalink
Merge pull request #36 from dynamicweb/dbe/20222-Null-handling
Browse files Browse the repository at this point in the history
20222-Null-handling
  • Loading branch information
MatthiasSort authored Jul 3, 2024
2 parents cd916b0 + 810539b commit 63effde
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.0.23</Version>
<Version>10.6.0</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 All @@ -15,7 +15,7 @@
<Copyright>Copyright © 2023 Dynamicweb Software A/S</Copyright>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -24,8 +24,8 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dynamicweb.DataIntegration" Version="10.0.24" />
<PackageReference Include="Dynamicweb.Ecommerce" Version="10.0.34" />
<PackageReference Include="Dynamicweb.DataIntegration" Version="10.6.2" />
<PackageReference Include="Dynamicweb.Ecommerce" Version="10.6.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
Expand Down
32 changes: 17 additions & 15 deletions src/ODataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -686,29 +686,31 @@ public override bool RunJob(Job job)
while (!sourceReader.IsDone())
{
var sourceRow = sourceReader.GetNext();
ProcessInputRow(mapping, sourceRow);
writer.Write(sourceRow);
if (sourceReaderIsResponseWriter)
if (ProcessInputRow(sourceRow, mapping))
{
if (writer.PostBackObject != null && writer.PostBackObject.Count > 0)
writer.Write(sourceRow);
if (sourceReaderIsResponseWriter)
{
Dictionary<string, object> responseToWrite = new Dictionary<string, object>();
foreach (var item in responseMappingCollection)
if (writer.PostBackObject != null && writer.PostBackObject.Count > 0)
{
if (item.HasScriptWithValue)
Dictionary<string, object> responseToWrite = new Dictionary<string, object>();
foreach (var item in responseMappingCollection)
{
responseToWrite.Add(item.DestinationColumn.Name, item.GetScriptValue());
}
else
{
var postBackValue = writer.GetPostBackValue(item);
if (postBackValue != null)
if (item.HasScriptWithValue)
{
responseToWrite.Add(item.DestinationColumn.Name, item.GetScriptValue());
}
else
{
responseToWrite.Add(item.DestinationColumn.Name, postBackValue);
var postBackValue = writer.GetPostBackValue(item);
if (postBackValue != null)
{
responseToWrite.Add(item.DestinationColumn.Name, postBackValue);
}
}
}
responseMappingWriter.Write(responseToWrite);
}
responseMappingWriter.Write(responseToWrite);
}
}
}
Expand Down

0 comments on commit 63effde

Please sign in to comment.