I have a domain model for a project that can be used with multiple data storage endpoints.
I want to use it with DynamoDB. Dynamo provides object-persistence approach that allows you to annotate properties of a class with structure elements of a DynamoDB collection (i.e. [DynamoDBTable]
, [DynamoDBHashKey]
, [DynamoDBLocalSecondaryIndexRangeKey]
, etc). I would like to keep my Domain model clean so I do not want to decorate it with these endpoint specific annotations.
I know I could use Dynamo Document Model approach but I like the organization of attaching the attributes to properties.
To satisfy both wants, is there a way to inherit my domain model and apply those dynamo annotations in the sub class? Or alternatively, is there a way to apply the data annotations programatically?