From 942183d3a3701322abc68fa796ce596bb4b3b725 Mon Sep 17 00:00:00 2001 From: Bo Blodgett Date: Fri, 13 Dec 2024 15:47:10 -0800 Subject: [PATCH] Fixed bug where if RetrieveDateTimeInUtc was not set on the operation or context config the value was still defaulted to false. --- sdk/src/Services/DynamoDBv2/Custom/DataModel/Configs.cs | 2 +- sdk/test/Services/DynamoDBv2/IntegrationTests/DataModelTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/src/Services/DynamoDBv2/Custom/DataModel/Configs.cs b/sdk/src/Services/DynamoDBv2/Custom/DataModel/Configs.cs index b094bbe9d8ee..42e52e5b9679 100644 --- a/sdk/src/Services/DynamoDBv2/Custom/DataModel/Configs.cs +++ b/sdk/src/Services/DynamoDBv2/Custom/DataModel/Configs.cs @@ -424,7 +424,7 @@ public DynamoDBFlatConfig(DynamoDBOperationConfig operationConfig, DynamoDBConte bool consistentRead = operationConfig.ConsistentRead ?? contextConfig.ConsistentRead ?? false; bool skipVersionCheck = operationConfig.SkipVersionCheck ?? contextConfig.SkipVersionCheck ?? false; bool ignoreNullValues = operationConfig.IgnoreNullValues ?? contextConfig.IgnoreNullValues ?? false; - bool retrieveDateTimeInUtc = operationConfig.RetrieveDateTimeInUtc ?? contextConfig.RetrieveDateTimeInUtc ?? false; + bool retrieveDateTimeInUtc = operationConfig.RetrieveDateTimeInUtc ?? contextConfig.RetrieveDateTimeInUtc ?? true; bool isEmptyStringValueEnabled = operationConfig.IsEmptyStringValueEnabled ?? contextConfig.IsEmptyStringValueEnabled ?? false; DynamoDBEntryConversion conversion = operationConfig.Conversion ?? contextConfig.Conversion ?? DynamoDBEntryConversion.CurrentConversion; string tableNamePrefix = operationConfig.TableNamePrefix ?? contextConfig.TableNamePrefix ?? string.Empty; diff --git a/sdk/test/Services/DynamoDBv2/IntegrationTests/DataModelTests.cs b/sdk/test/Services/DynamoDBv2/IntegrationTests/DataModelTests.cs index 4405406d0e83..24c04342f0a0 100644 --- a/sdk/test/Services/DynamoDBv2/IntegrationTests/DataModelTests.cs +++ b/sdk/test/Services/DynamoDBv2/IntegrationTests/DataModelTests.cs @@ -980,7 +980,7 @@ private void TestHashObjects() Assert.AreEqual(product.KeySizes.Count, retrieved.KeySizes.Count); Assert.IsNotNull(retrieved.CompanyInfo); Assert.AreEqual(product.CompanyInfo.Name, retrieved.CompanyInfo.Name); - Assert.AreEqual(product.CompanyInfo.Founded, retrieved.CompanyInfo.Founded); + Assert.AreEqual(product.CompanyInfo.Founded.ToUniversalTime(), retrieved.CompanyInfo.Founded); Assert.AreNotEqual(product.CompanyInfo.Revenue, retrieved.CompanyInfo.Revenue); Assert.AreEqual(product.CompanyInfo.AllProducts.Count, retrieved.CompanyInfo.AllProducts.Count); Assert.AreEqual(product.CompanyInfo.AllProducts[0].Id, retrieved.CompanyInfo.AllProducts[0].Id);