getting this error object does not contain a definition for and no accessible extension method on result
token = auth.GetTokenAsync(new Uri(TokenURL), PCAClientUID, PCASecret, EnsResource, "OAuthV2")result;
What I have tried:
public string GetToken1()
{
token = CacheEngine.Get<string>(tokenkey);
if (string.IsNullOrEmpty(token))
{
AuthTokenGeneration auth = new();
//TokenURL = Convert.ToString(configuration["Shared:TokenURL"]);
token = auth.GetTokenAsync(new Uri(TokenURL), PCAClientUID, PCASecret, EnsResource, "OAuthV2").result;
CacheEngine.Set<string>(tokenkey, token, cacheInterval);
}
HttpClient httpClient = new();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
HttpContent content = new StringContent(JsonConvert.SerializeObject(pcaStandardActionPayload), Encoding.UTF8, "application/json");
var postResult = httpClient.PostAsync(EnsAmNotificationUrl, content).Result;
return token;
}