From e751779da464e2f9a9c5e86ab4da13d7282bb342 Mon Sep 17 00:00:00 2001 From: alliscode Date: Wed, 15 Apr 2026 17:05:22 -0700 Subject: [PATCH] Fix IDE0009: add 'this' qualification in DevTemporaryTokenCredential Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../HostedAgentsV2/Hosted-ChatClientAgent/Program.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Program.cs b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Program.cs index e7dcf415f7..5e26322079 100644 --- a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Program.cs +++ b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Program.cs @@ -73,26 +73,26 @@ internal sealed class DevTemporaryTokenCredential : TokenCredential public DevTemporaryTokenCredential() { - _token = Environment.GetEnvironmentVariable(EnvironmentVariable); + this._token = Environment.GetEnvironmentVariable(EnvironmentVariable); } public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) { - return GetAccessToken(); + return this.GetAccessToken(); } public override ValueTask GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) { - return new ValueTask(GetAccessToken()); + return new ValueTask(this.GetAccessToken()); } private AccessToken GetAccessToken() { - if (string.IsNullOrEmpty(_token)) + if (string.IsNullOrEmpty(this._token)) { throw new CredentialUnavailableException($"{EnvironmentVariable} environment variable is not set."); } - return new AccessToken(_token, DateTimeOffset.UtcNow.AddHours(1)); + return new AccessToken(this._token, DateTimeOffset.UtcNow.AddHours(1)); } }