There is an asynchronous method:

public Task<List<Address>> GetAllByStreet(string street) { return db.QueryAsync<Address>( "SELECT DISTINCT House as Title, " + "NULL as Type, " + "NULL as Status, " + "0 as Visibility FROM Quest WHERE Street = ?", street); } 

I try to call it when I click on the Item in the ListView :

 private async void ListViewAddresses_ItemTapped(object sender, ItemTappedEventArgs e) { List<Address> allHouse = await dataBaseController.GetAllByStreet((e.Item as Address).Street); } 

But the method does not work. Although, if you call it in a separate asynchronous method, then everything will work. What's wrong?

    1 answer 1

    You do not have instructions that you want to receive a callback.

    GetAllByStreet should also contain async / await.

    async void gives the instruction "run and do not break when an error occurs", which may lead in aggregate to the illusion "does not work".