[Solved] why instance variable returns null in c#? [closed]


So, where you call GetSingleLocationInfo, you are calling an async method. GetSingleLocationInfo calwill therefore run as far as the await statement then return stright to the caller, before the it httpClient.GetStringAsync(hereNetUrl); has returned.

To fix this, you need to await on your call GetSingleLocationInfo before trying to access the variable.

1

solved why instance variable returns null in c#? [closed]