Skip to content

Object property cannot have >1 DynamoDBPropertyAttribute #32

@howcheng

Description

@howcheng

If a property is part of the primary key and also an index, there's an exception thrown when trying to determine the property converter.

Example:

[DynamoDBHashKey("ColumnName", typeof(My.Project.Converter)]
[DynamoDBGlobalSecondaryIndexHashKey("My-index-name", Converter = typeof(My.Project.Converter)]
public int MyProperty { get; set; }

The error is in DynamoDbConversionUtils.GetPropertyConverter():

var propertyAttribute = propInfo.GetCustomAttributes(typeof(DynamoDBAttribute), true)
      .OfType<DynamoDBPropertyAttribute>()
      .SingleOrDefault();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions