As a simple example, I would like to show all users in a database, and the API provides the async method ShowUsersAsync()
.
public async Task<InfluxResult<UserRow>> ShowUsersAsync()
/// SHOW all existing users and their admin status.
Now, I am trying to do the following.
class MainClass
{
public static void Main(string[] args)
{
var client = new InfluxClient(new Uri("http://localhost:8086"));
**//"How do I run it here?"** TestAsync
Console.WriteLine("PRINT ALL USERS");
}
public async void TestAsync(InfluxClient client)
{
var users = await client.ShowUsersAsync();
}
}
Am I missing something about async and await?
API reference: https://github.com/MikaelGRA/InfluxDB.Client