From 4577cfc7c17ef7faa7df81ffa87d2e1c4bb5f8cc Mon Sep 17 00:00:00 2001 From: Matthias Sebastian Sort Date: Thu, 8 Aug 2024 13:06:25 +0200 Subject: [PATCH] Added logic so when having the provider as source and use $filter on endpoint and conditionals on the tablemapping and it is a single entity endpoint it will merge the two $filters --- src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj | 2 +- src/ODataSourceReader.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj index ef42dce..c708fdf 100644 --- a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj @@ -1,6 +1,6 @@  - 10.6.0 + 10.6.1 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/ODataSourceReader.cs b/src/ODataSourceReader.cs index 0b694f6..532cc67 100644 --- a/src/ODataSourceReader.cs +++ b/src/ODataSourceReader.cs @@ -188,6 +188,10 @@ internal void CallEndpoing(IDictionary headers, bool readFromLas { parameters.Add(parameter.Key, parameter.Value); } + else if (parameter.Key.Equals("$filter", StringComparison.OrdinalIgnoreCase) && !ODataProvider.EndpointIsLoadAllEntities(_endpoint.Url)) + { + parameters[parameter.Key] = $"{parameters[parameter.Key]} and {parameter.Value}"; + } } }