Skip to content

Commit fa16a5d

Browse files
committed
Upgrade to .net 9
1 parent 21f3fdc commit fa16a5d

File tree

15 files changed

+113
-148
lines changed

15 files changed

+113
-148
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Setup .NET
20-
uses: actions/setup-dotnet@v3
20+
uses: actions/setup-dotnet@v4
2121
with:
22-
dotnet-version: 8.0.x
22+
dotnet-version: 9.0.x
2323
- name: Restore dependencies
2424
run: dotnet restore
2525
- name: Build

Directory.Build.props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project>
2+
<PropertyGroup>
3+
<TargetFramework>net9.0</TargetFramework>
4+
<Nullable>enable</Nullable>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Deterministic>true</Deterministic>
7+
<RunCodeAnalysis>true</RunCodeAnalysis>
8+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
9+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
10+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
11+
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
12+
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
13+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
14+
<NoWarn>$(NoWarn);CS1591;</NoWarn>
15+
</PropertyGroup>
16+
</Project>

Directory.Packages.props

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
8+
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
9+
<PackageVersion Include="AutoFixture" Version="4.18.1" />
10+
<PackageVersion Include="AutoMapper" Version="[14.0.0]" />
11+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
12+
<PackageVersion Include="FluentAssertions" Version="[7.2.0]" />
13+
<PackageVersion Include="FluentValidation" Version="12.0.0" />
14+
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
15+
<PackageVersion Include="MediatR" Version="[12.5.0]" />
16+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9" />
17+
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
18+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.9" />
19+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.9" />
20+
<PackageVersion Include="Microsoft.Extensions.ApiDescription.Server" Version="9.0.9" />
21+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
22+
<PackageVersion Include="NSubstitute" Version="5.3.0" />
23+
<PackageVersion Include="Serilog.AspNetCore" Version="9.0.0" />
24+
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
25+
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
26+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="9.0.4" />
27+
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="9.0.4" />
28+
<PackageVersion Include="xunit" Version="2.9.3" />
29+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
30+
</ItemGroup>
31+
</Project>

DummyWebApiDemo.sln

Lines changed: 0 additions & 72 deletions
This file was deleted.

DummyWebApiDemo.slnx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Solution>
2+
<Folder Name="/files/">
3+
<File Path=".editorconfig" />
4+
<File Path=".github/workflows/ci.yml" />
5+
<File Path="global.json" />
6+
<File Path="README.md" />
7+
<File Path="Directory.Packages.props" />
8+
<File Path="Directory.Build.props" />
9+
</Folder>
10+
<Folder Name="/src/">
11+
<Project Path="src/Api/Api.csproj" />
12+
<Project Path="src/Application/Application.csproj" />
13+
<Project Path="src/Domain/Domain.csproj" />
14+
<Project Path="src/Infrastructure/Infrastructure.csproj" />
15+
</Folder>
16+
<Folder Name="/test/">
17+
<Project Path="test/IntegrationTests/IntegrationTests.csproj" />
18+
<Project Path="test/UnitTests/UnitTests.csproj" />
19+
</Folder>
20+
</Solution>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Using a web api to play with dummies
88
In this demo, i m using a web api in order to get (or create) dummies from (or in) an sql database.
99
>
1010
11-
**`Tools`** : net 8.0, mediatr, automapper, fluent-validation, entity-framework, unit-testing, integration-testing
11+
**`Tools`** : net 9.0, mediatr, automapper, fluent-validation, entity-framework, unit-testing, integration-testing

global.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"sdk": {
3-
"version": "net8.0"
3+
"version": "9.0.200",
4+
"rollForward": "latestFeature",
5+
"allowPrerelease": true
46
}
57
}

oas/Api.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi": "3.0.1",
2+
"openapi": "3.0.4",
33
"info": {
44
"title": "DummyWebApiDemo",
55
"version": "1"
@@ -15,15 +15,14 @@
1515
"name": "dummyId",
1616
"in": "path",
1717
"required": true,
18-
"style": "simple",
1918
"schema": {
2019
"type": "string"
2120
}
2221
}
2322
],
2423
"responses": {
2524
"200": {
26-
"description": "Success"
25+
"description": "OK"
2726
}
2827
}
2928
}
@@ -44,7 +43,7 @@
4443
},
4544
"responses": {
4645
"200": {
47-
"description": "Success"
46+
"description": "OK"
4847
}
4948
}
5049
}

oas/Api_v2.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi": "3.0.1",
2+
"openapi": "3.0.4",
33
"info": {
44
"title": "DummyWebApiDemo",
55
"version": "2"
@@ -12,7 +12,7 @@
1212
],
1313
"responses": {
1414
"200": {
15-
"description": "Success"
15+
"description": "OK"
1616
}
1717
}
1818
},
@@ -31,7 +31,7 @@
3131
},
3232
"responses": {
3333
"200": {
34-
"description": "Success"
34+
"description": "OK"
3535
}
3636
}
3737
}
@@ -45,15 +45,14 @@
4545
{
4646
"name": "Keyword",
4747
"in": "query",
48-
"style": "form",
4948
"schema": {
5049
"type": "string"
5150
}
5251
}
5352
],
5453
"responses": {
5554
"200": {
56-
"description": "Success"
55+
"description": "OK"
5756
}
5857
}
5958
}
@@ -68,15 +67,14 @@
6867
"name": "dummyId",
6968
"in": "path",
7069
"required": true,
71-
"style": "simple",
7270
"schema": {
7371
"type": "string"
7472
}
7573
}
7674
],
7775
"responses": {
7876
"200": {
79-
"description": "Success"
77+
"description": "OK"
8078
}
8179
}
8280
}

src/Api/Api.csproj

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
74
<OpenApiDocumentsDirectory>$(SolutionDir)\oas</OpenApiDocumentsDirectory>
85
<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>
96
<OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild>
107
</PropertyGroup>
118

129
<ItemGroup>
13-
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
14-
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
15-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.4" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
10+
<PackageReference Include="Asp.Versioning.Mvc" />
11+
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" />
12+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
1714
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1815
<PrivateAssets>all</PrivateAssets>
1916
</PackageReference>
20-
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="8.0.4">
17+
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server">
2118
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2219
<PrivateAssets>all</PrivateAssets>
2320
</PackageReference>
24-
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
25-
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
26-
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
27-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
28-
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
21+
<PackageReference Include="Serilog.AspNetCore" />
22+
<PackageReference Include="Serilog.Sinks.Console" />
23+
<PackageReference Include="Serilog.Sinks.File" />
24+
<PackageReference Include="Swashbuckle.AspNetCore" />
25+
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" />
2926
</ItemGroup>
3027

3128
<ItemGroup>

0 commit comments

Comments
 (0)