Comments (4)
Hi @JicoDotNet. Thank you for reaching out and we regret that you're experiencing difficulties. The method signatures are correct. They are intended to represent an IAsyncEnumerable<T>
that you can iterate through rather than a Task<T>
. Your application would consume this in the same way as the Query Tables example demonstrates, but using the asynchronous form:
AsyncPageable<TableItem> queryTableResults = serviceClient.QueryAsync(filter: $"TableName eq '{tableName}'");
Console.WriteLine("The following are the names of the tables in the query results:");
// Iterate the <see cref="Pageable"> in order to access queried tables.
await foreach (TableItem table in queryTableResults)
{
Console.WriteLine(table.Name);
}
More information can be found in Iterating with Async Enumerables in C# 8.
from azure-sdk-for-net.
Hi @JicoDotNet. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.
from azure-sdk-for-net.
Hi @jsquire, Thanks for your support. Can you please help me on the code below. I'm getting an error for this code block.
public async Task<List<Person>> GetPersons(string Query)
{
try
{
TableServiceClient tableServiceClient = new TableServiceClient("my_storage_account_connection_string");
TableClient myTableClient = tableServiceClient.GetTableClient("my_table_name");
return await myTableClient.QueryAsync<Person>(Query).ToBlockingEnumerable().ToList();
}
catch (Exception)
{
throw;
}
}
Receiving below ERROR.
Error CS1061 'List' does not contain a definition for 'GetAwaiter' and no accessible extension method 'GetAwaiter' accepting a first argument of type 'List' could be found (are you missing a using directive or an assembly reference?)
from azure-sdk-for-net.
The standard ToList
only works with IEnumerable<T>
, not with IAsyncEnumerable<T>
. Your options would be to consider using a package like System.Linq.Async to give you assess to ToListAsync()
or you would need to write your own loop to do the conversion:
var results = new List<TableItem>();
var queryTableResults = serviceClient.QueryAsync(filter: $"TableName eq '{tableName}'");
await foreach (TableItem table in queryTableResults)
{
results.Add(table);
}
from azure-sdk-for-net.
Related Issues (20)
- [FEATURE REQ] Add CacheControl as a configurable option for new blobs in BlobCheckpointStore HOT 15
- [BUG] Inconsistent Region disply name for US GOV locations HOT 4
- [BUG] Calling Azure.Analytics.Purview.Account's GetCollections() won't compile
- Queries about to One to One chat and same client Rejoing same group with previous chat HOT 1
- [DocumentIntelligence] ClassifyDocumentCanParseBlankPage failing with InternalServerError
- [QUERY] Is there an API to list all assets under a collection?
- Parameter validation
- Azure.AI.OpenAI beta.13 broken for bring your own data HOT 1
- [FEATURE REQ] Add support for Logprobs in OpenAI Chat Completions HOT 1
- Assets.json file should be auto-created for new projects HOT 3
- [BUG] BlobCopyFromUriOptions Metadata causing ASCII header exceptions on Linux HOT 2
- CDK / Aspire (P5) priorities. HOT 1
- KeyVault for CDK
- How do we set a secret's value via the CDK; we anticipate that people will want to set secrets during deployment to capture parameter values. HOT 1
- KeyVault name should be generated based on the RG and resource name: `toLower(take(concat('mykv', uniqueString(resourceGroup().id)), 24))`
- We need role definitions for KeyVault in CDK.
- CDK new KeyVault(...) should not automatically define output.
- [BUG] Event hub consumer stops processing event hub messages for a specific period HOT 24
- Can't set Normalizer or CustomNormalizer for a field in a search index via SDK? HOT 3
- [FEATURE REQ] Azure.Monitor.OpenTelemetry - synchronize TargetFramework across packages HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-net.