diff --git a/ess/src/API/EMBC.ESS.Utilities.Dynamics/DynamicsODataClientHandler.cs b/ess/src/API/EMBC.ESS.Utilities.Dynamics/DynamicsODataClientHandler.cs index d760c844e..fe8b44a0b 100644 --- a/ess/src/API/EMBC.ESS.Utilities.Dynamics/DynamicsODataClientHandler.cs +++ b/ess/src/API/EMBC.ESS.Utilities.Dynamics/DynamicsODataClientHandler.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Options; using Microsoft.OData.Client; using Microsoft.OData.Extensions.Client; +using Microsoft.OData; namespace EMBC.ESS.Utilities.Dynamics { @@ -26,8 +27,9 @@ public void OnClientCreated(ClientCreatedArgs args) client.EntityParameterSendOption = EntityParameterSendOption.SendOnlySetProperties; client.Configurations.RequestPipeline.OnEntryStarting((arg) => { - // do not send reference properties and null values to Dynamics - arg.Entry.Properties = arg.Entry.Properties.Where((prop) => !prop.Name.StartsWith('_') && prop.Value != null); + arg.Entry.Properties = arg.Entry.Properties + .OfType() + .Where(prop => !prop.Name.StartsWith('_') && prop.Value != null); }); client.BuildingRequest += Client_BuildingRequest; client.SendingRequest2 += Client_SendingRequest2; diff --git a/ess/src/API/EMBC.Tests.Integration.ESS/EMBC.Tests.Integration.ESS.csproj b/ess/src/API/EMBC.Tests.Integration.ESS/EMBC.Tests.Integration.ESS.csproj index f6d1a113e..e0f080233 100644 --- a/ess/src/API/EMBC.Tests.Integration.ESS/EMBC.Tests.Integration.ESS.csproj +++ b/ess/src/API/EMBC.Tests.Integration.ESS/EMBC.Tests.Integration.ESS.csproj @@ -16,6 +16,7 @@ + diff --git a/registrants/src/API/EMBC.Registrants.API/EMBC.Registrants.API.csproj b/registrants/src/API/EMBC.Registrants.API/EMBC.Registrants.API.csproj index d8b109c3d..30b8714a2 100644 --- a/registrants/src/API/EMBC.Registrants.API/EMBC.Registrants.API.csproj +++ b/registrants/src/API/EMBC.Registrants.API/EMBC.Registrants.API.csproj @@ -21,6 +21,7 @@ +