Dynamo DB C# Document Object Modal use Seconday index with LoadAsync

Viewed 314

Using Dynamo Object Persistence Modal with C#

Consider the object

class SomeObject{
 [DynamoDBHashKey]
 public string A {get; set;}

 [DynamoDBGlobalSecondaryIndexHashKey]
 [DynamoDBRangeKey]
 public string B {get; set;}
}

The below code works fine with an object has to be queried in a table

 _dynamoDbContext.LoadAsync<SomeObject>(new SomeObject(){ A = "test", B = "test" })

I have a secondary index on the same table and would like to retrieve the value

_dynamoDbContext.LoadAsync<SomeObject>(new SomeObject(){ B = "test" }, new DynamoDBOperationConfig()
        {
            IndexName = "Some_Index_Name"
        };)

I cant find any documentation on this, but expected this to work.

I know it can be done with QueryAsync, but is there a way it works with LoadAsync ?

0 Answers
Related