Skip to content

Commit 8f41208

Browse files
committed
fix GetWorkflowInstances for DynamoDB provider
1 parent 0ccb792 commit 8f41208

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/providers/WorkflowCore.Providers.AWS/Services/DynamoPersistenceProvider.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,24 @@ public async Task<IEnumerable<WorkflowInstance>> GetWorkflowInstances(IEnumerabl
125125
return new List<WorkflowInstance>();
126126
}
127127

128-
var keys = new Dictionary<string, AttributeValue>();
128+
var keys = new KeysAndAttributes() { Keys = new List<Dictionary<string, AttributeValue>>() };
129129
foreach (var id in ids)
130130
{
131-
keys.Add("id", new AttributeValue { S = id });
131+
var key = new Dictionary<string, AttributeValue>()
132+
{
133+
{
134+
"id", new AttributeValue { S = id }
135+
}
136+
};
137+
keys.Keys.Add(key);
132138
}
133139

134140
var request = new BatchGetItemRequest
135141
{
136142
RequestItems = new Dictionary<string, KeysAndAttributes>()
137143
{
138144
{
139-
$"{_tablePrefix}-{WORKFLOW_TABLE}",
140-
new KeysAndAttributes
141-
{
142-
Keys = new List<Dictionary<string, AttributeValue> >() { keys }
143-
}
145+
$"{_tablePrefix}-{WORKFLOW_TABLE}", keys
144146
}
145147
}
146148
};

0 commit comments

Comments
 (0)