You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the DynamoDB context users can attribute their classes with attributes like DynamoDBHashKey, DynamoDBRangeKey and DynamoDBProperty. These attributes allow overriding the property name. Currently when the mapper is used with classes containing those attributes all renamed property need to redundantly declare JsonPropertyName to make the mapper respect the proper names.
With .NET 7 and higher it is possible to add IJsonTypeInfoResolver implementations that get access to either reflection based or source generation based metadata. With that in place it is possible to extract the property information, check for the attributes and emit corresponding property names automatically which would make it possible to use a class without having to attribute properties. Example
Describe the feature.
When using the DynamoDB context users can attribute their classes with attributes like
DynamoDBHashKey
,DynamoDBRangeKey
andDynamoDBProperty
. These attributes allow overriding the property name. Currently when the mapper is used with classes containing those attributes all renamed property need to redundantly declareJsonPropertyName
to make the mapper respect the proper names.With .NET 7 and higher it is possible to add
IJsonTypeInfoResolver
implementations that get access to either reflection based or source generation based metadata. With that in place it is possible to extract the property information, check for the attributes and emit corresponding property names automatically which would make it possible to use a class without having to attribute properties. ExampleAdditional Context
Pseudo code (just a brainstorm, there might be more elegant solutions)
The text was updated successfully, but these errors were encountered: