Skip to content

Fix ArrayDdbConverter ArgumentOutOfRangeException#280

Merged
firenero merged 2 commits intoAllocZero:mainfrom
jsneedles:main
Jan 31, 2026
Merged

Fix ArrayDdbConverter ArgumentOutOfRangeException#280
firenero merged 2 commits intoAllocZero:mainfrom
jsneedles:main

Conversation

@jsneedles
Copy link
Contributor

I was trying to do a .ToDocument call on an entity with an array property and was getting:

   at System.Collections.Generic.List`1.set_Item(Int32 index, T value)
   at EfficientDynamoDb.Internal.Converters.Collections.ArrayDdbConverter`1.Write(T[]& value)
   at EfficientDynamoDb.Internal.Metadata.DdbPropertyInfo`1.SetDocumentValue(Object obj, Document document)
   at EfficientDynamoDb.Internal.Extensions.DocumentExtensions.ToDocument[T](T entity, DynamoDbContextMetadata metadata)
   at EfficientDynamoDb.Internal.Converters.ObjectDdbConverter`1.Write(T& value)
   at EfficientDynamoDb.Internal.Metadata.DdbPropertyInfo`1.SetDocumentValue(Object obj, Document document)
   at EfficientDynamoDb.Internal.Extensions.DocumentExtensions.ToDocument[T](T entity, DynamoDbContextMetadata metadata)
   at EfficientDynamoDb.DynamoDbContext.ToDocument[T](T entity)

Dug through and found this small bug.

When doing operations directly like Batch.PutItem and similar, it seems to write just fine, so probably goes through a different code path.

@firenero
Copy link
Contributor

Thanks for submitting the PR @jsneedles. There was the same bug in IReadOnlyCollectionDdbConverter.cs so I applied the same fix there.

@firenero firenero merged commit 803510e into AllocZero:main Jan 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments