Reputation: 523
I must be missing something obvious here. But I cant see wat I did wrong. I have the following code:
var resp = await client.findItemsByCategoryAsync(request);
But this code give me the following compiler error:
Though it says awaitable I cannot use the await keyword. The method is provided by a WCF service (Ebay Finding API)
Upvotes: 3
Views: 591
Reputation: 9201
The method containing the await
operator must also be declared as async
.
public async void YourMethodAsync()
{
var resp = await client.findItemsByCategoryAsync(request);
}
The error message refers the current method, not the one you're calling await on.
Upvotes: 4