feat: Add support for retrieving DateTime attributes in UTC timezone from a DynamoDB table #3098
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for retrieving
DateTime
attributes in UTC timezone from a DynamoDB table.While working in the data model mode, this PR introduces a boolean flag called
RetrieveDateTimeInUtc
as part of theDynamoDBContextConfig
as well as the globalAWSConfigsDynamoDB.Context
. If set totrue
, then allDateTime
attributes are retrieved in the UTC timezone.While working in the document model mode, Each
Document
object stores attributes as aDynamoDBEntry
. The SDK already has theAsDateTime
virtual method that is used to convert aDynamoDBEntry
to aDateTime
object. This PR also introduces aAsDateTimeUtc
method to retrieve allDateTime
attributes in the UTC timezone.Motivation and Context
Fixes #1450 and DOTNET-7259
Testing
Added new unit and integration tests.
Successful dry-run (build-id:
39a8ce27-a0db-4976-8ee4-5bd6f6a41004
and693449ba-8bf6-4280-bf21-fc8ec0bdf2d3
)Screenshots (if appropriate)
Types of changes
Checklist
License