diff --git a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj index c708fdf..5c612d7 100644 --- a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj @@ -1,6 +1,6 @@  - 10.6.1 + 10.6.2 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 532cc67..3138d83 100644 --- a/src/ODataSourceReader.cs +++ b/src/ODataSourceReader.cs @@ -315,7 +315,7 @@ private string GetModeAsParameters() if (!string.IsNullOrWhiteSpace(dateTimeFilterName)) { - var theDateTime = ODataWriter.GetTheDateTimeInZeroTimeZone(lastRunDateTime.Value.ToString(CultureInfo.InvariantCulture), isEdmDate); + var theDateTime = ODataWriter.GetTheDateTimeInZeroTimeZone(lastRunDateTime.Value, isEdmDate); if (isEdmDate) { dateTimeFilterName += " ge " + theDateTime; diff --git a/src/ODataWriter.cs b/src/ODataWriter.cs index 17fbd42..6438071 100644 --- a/src/ODataWriter.cs +++ b/src/ODataWriter.cs @@ -318,7 +318,7 @@ internal string MapValuesToJSon(Dictionary row, bool isPatchRequ public static string GetTheDateTimeInZeroTimeZone(object dateTimeObject, bool isEdmDate) { - var dateTime = Converter.ToDateTime(dateTimeObject); + DateTime dateTime = (dateTimeObject is not null && dateTimeObject is DateTime) ? (DateTime)dateTimeObject : Converter.ToDateTime(dateTimeObject); DateTime dateTimeInUtc; if (SqlDateTime.MinValue.Value == dateTime || DateTime.MinValue == dateTime) {