Skip to content

Commit

Permalink
Upgrade dotnet sample to .NET 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BalintBanyasz committed Dec 6, 2023
1 parent 1384dd1 commit b9037db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<UserSecretsId>be67fb9c-fa2a-411d-b951-42cd6e9c35fd</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions dotnet/Fluentax.Apis.ExchangeRates.Samples/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json.Serialization;
using Microsoft.Extensions.Configuration;

var builder = new ConfigurationBuilder()
Expand All @@ -23,7 +24,7 @@
using var response = await tokenClient.PostAsync(config["Auth:TokenEndpoint"], tokenRequestContent);

var tokenResponse = await response.Content.ReadFromJsonAsync<TokenResponse>();
token = tokenResponse.access_token;
token = tokenResponse.AccessToken;
}

using var apiClient = new HttpClient
Expand All @@ -43,5 +44,6 @@

record TokenResponse
{
public string access_token { get; set; }
[JsonPropertyName("access_token")]
public string AccessToken { get; set; }
}

0 comments on commit b9037db

Please sign in to comment.