Skip to content

Commit 63b40fc

Browse files
committed
Upgrade to .NET 10
1 parent a0c1a76 commit 63b40fc

File tree

7 files changed

+19
-21
lines changed

7 files changed

+19
-21
lines changed

App/Api/Setup/ApiEndpoints.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
using System.Globalization;
21
using System.Net;
32
using Asp.Versioning;
4-
using Microsoft.OpenApi.Any;
53
using Services;
64

75
namespace Api.Setup;
86

97
internal static class ApiEndpoints
108
{
11-
private static readonly OpenApiString s_exampleFromDate = new(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
12-
private static readonly OpenApiString s_exampleToDate = new(DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
9+
// private static readonly OpenApiString s_exampleFromDate = new(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
10+
// private static readonly OpenApiString s_exampleToDate = new(DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
1311

1412
public static void ConfigureEndpoints(this WebApplication app)
1513
{
@@ -42,8 +40,8 @@ public static void ConfigureEndpoints(this WebApplication app)
4240
.WithDescription("Get longest downward trend in days between given dates")
4341
.WithOpenApi(operation =>
4442
{
45-
operation.Parameters[0].Example = s_exampleFromDate;
46-
operation.Parameters[^1].Example = s_exampleToDate;
43+
// operation.Parameters[0].Example = s_exampleFromDate;
44+
// operation.Parameters[^1].Example = s_exampleToDate;
4745
return operation;
4846
})
4947
.Produces<HighestTradingVolumeResponse>((int)HttpStatusCode.OK)
@@ -76,8 +74,8 @@ public static void ConfigureEndpoints(this WebApplication app)
7674
.WithDescription("Get the date with the highest trading volume between given dates")
7775
.WithOpenApi(operation =>
7876
{
79-
operation.Parameters[0].Example = s_exampleFromDate;
80-
operation.Parameters[^1].Example = s_exampleToDate;
77+
// operation.Parameters[0].Example = s_exampleFromDate;
78+
// operation.Parameters[^1].Example = s_exampleToDate;
8179
return operation;
8280
})
8381
.Produces<HighestTradingVolumeResponse>((int)HttpStatusCode.OK)
@@ -110,8 +108,8 @@ public static void ConfigureEndpoints(this WebApplication app)
110108
.WithDescription("Get pair of dates when it is best to buy and sell between given dates")
111109
.WithOpenApi(operation =>
112110
{
113-
operation.Parameters[0].Example = s_exampleFromDate;
114-
operation.Parameters[^1].Example = s_exampleToDate;
111+
// operation.Parameters[0].Example = s_exampleFromDate;
112+
// operation.Parameters[^1].Example = s_exampleToDate;
115113
return operation;
116114
})
117115
.Produces<BuyAndSellResponse>((int)HttpStatusCode.OK)

App/Directory.Packages.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
8-
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.4" />
9-
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="9.0.4" />
10-
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.4" />
11-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.4" />
8+
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0-preview.3.25172.1" />
9+
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="10.0.0-preview.3.25172.1" />
10+
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.0-preview.3.25171.5" />
11+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0-preview.3.25171.5" />
1212
<PackageVersion Include="Scalar.AspNetCore" Version="2.1.13" />
1313
<PackageVersion Include="Serilog" Version="4.2.0" />
1414
<PackageVersion Include="Serilog.Extensions.Hosting" Version="9.0.0" />

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<Nullable>enable</Nullable>
55
<LangVersion>latest</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview-alpine AS build
22

33
WORKDIR /app
44

@@ -10,7 +10,7 @@ RUN dotnet restore ./Api/Api.csproj
1010

1111
RUN dotnet publish ./Api/Api.csproj -c Release --no-restore -o /app/publish /p:UseAppHost=false
1212

13-
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine
13+
FROM mcr.microsoft.com/dotnet/aspnet:10.0-preview-alpine
1414

1515
COPY --from=build /app/publish .
1616

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ API documentation
1515

1616
Tools used:
1717

18-
- .NET 9 SDK
18+
- .NET 10 SDK
1919
- .NET report generator `dotnet tool install -g dotnet-reportgenerator-globaltool`
2020
- Docker

Tests/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.4" />
7+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-preview.3.25172.1" />
88
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
99
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
1010
<PackageVersion Include="NSubstitute" Version="5.3.0" />

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
3-
"version": "9.0.203",
3+
"version": "10.0.100-preview.3.25201.16",
44
"rollForward": "latestMinor",
55
"allowPrerelease": false
66
}
7-
}
7+
}

0 commit comments

Comments
 (0)