Click here to Skip to main content
15,886,752 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i have following method in C#.

C#
public async Task<ObservableCollection<Vehicle>> GetDataAsync(string vehicleId)


What I have tried:

i am calling this method using below code.

C#
var data =  GetDataAsync("123");


i am getting the following error message.

Id = 9, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}

can any one help how to call methods.

Thanks..
Posted
Updated 17-Nov-16 20:05pm

try explicit declaration

Task<observablecollection> task = GetDataAsync("123");

var result = await task;

But it seems from error that the calling method is also calling another async so better if use await

plz check also

Asynchronous Programming with Async and Await (C# and Visual Basic)[^]
 
Share this answer
 
v3
Comments
viprat 18-Nov-16 1:24am    
i tried this.. it is giving me the same error..
also put async before method name from where u'r calling this method.
 
Share this answer
 
v2
Comments
viprat 18-Nov-16 5:16am    
that is also not working...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900