public async Task <List <Music> > BatchGetAsync(List <Music> keyList) { var getter = DDBContext.CreateBatchGet <Music>(); keyList.ForEach((Music key) => { getter.AddKey(key.Artist, key.SongTitle); }); await getter.ExecuteAsync(); return(getter.Results); }
public async Task <List <T> > Get(IEnumerable <Guid> uniqueIds) { var config = new DynamoDBOperationConfig(); config.QueryFilter = new List <ScanCondition> { new ScanCondition("id", ScanOperator.Equal, uniqueIds) }; var batchRead = _context.CreateBatchGet <T>(config); foreach (var id in uniqueIds) { batchRead.AddKey(id); } await batchRead.ExecuteAsync(); return(batchRead.Results); }