Skip to content

Commit 487ffb3

Browse files
authored
Merge pull request #67 from marcominerva/develop
Update to .NET 9.0
2 parents 10e4f84 + a263891 commit 487ffb3

28 files changed

+84
-121
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ csharp_prefer_braces = true:silent
131131
csharp_prefer_simple_using_statement = true:suggestion
132132
csharp_style_namespace_declarations = file_scoped:suggestion
133133
csharp_style_prefer_method_group_conversion = true:silent
134+
csharp_prefer_system_threading_lock = true:suggestion
134135

135136
# Expression-level preferences
136137
csharp_prefer_simple_default_expression = true:suggestion

.github/workflows/codeql.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- cron: '0 0 1,15 * *'
1313

1414
env:
15-
NET_VERSION: '7.x'
15+
NET_VERSION: '9.x'
1616

1717
jobs:
1818
analyze:
@@ -41,10 +41,10 @@ jobs:
4141
with:
4242
dotnet-version: ${{ env.NET_VERSION }}
4343
dotnet-quality: 'ga'
44-
44+
4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v2
47+
uses: github/codeql-action/init@v3
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,11 +53,11 @@ jobs:
5353

5454
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5555
# queries: security-extended,security-and-quality
56-
56+
5757
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5858
# If this step fails, then you should remove it and run the build manually (see below)
5959
- name: Autobuild
60-
uses: github/codeql-action/autobuild@v2
60+
uses: github/codeql-action/autobuild@v3
6161

6262
# ?? Command-line programs to run using the OS shell.
6363
# ?? See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -70,4 +70,4 @@ jobs:
7070
# ./location_of_script_within_repo/buildscript.sh
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v2
73+
uses: github/codeql-action/analyze@v3

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
# Run Linter against code base #
4141
################################
4242
- name: Lint Code Base
43-
uses: github/super-linter@v4
43+
uses: super-linter/super-linter@v7.2.0
4444
env:
4545
LINTER_RULES_PATH: '.'
4646
EDITORCONFIG_FILE_NAME: '.editorconfig'

.github/workflows/publish_fluentvalidation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
env:
10-
NET_VERSION: '8.x'
10+
NET_VERSION: '9.x'
1111
PROJECT_NAME: src/MinimalHelpers.FluentValidation
1212
PROJECT_FILE: MinimalHelpers.FluentValidation.csproj
1313
TAG_NAME: fluentvalidation

.github/workflows/publish_openapi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
env:
10-
NET_VERSION: '8.x'
10+
NET_VERSION: '9.x'
1111
PROJECT_NAME: src/MinimalHelpers.OpenApi
1212
PROJECT_FILE: MinimalHelpers.OpenApi.csproj
1313
TAG_NAME: openapi

.github/workflows/publish_routing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
env:
10-
NET_VERSION: '8.x'
10+
NET_VERSION: '9.x'
1111
PROJECT_NAME: src/MinimalHelpers.Routing
1212
PROJECT_FILE: MinimalHelpers.Routing.csproj
1313
TAG_NAME: routing

.github/workflows/publish_routing_analyzers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
env:
10-
NET_VERSION: '8.x'
10+
NET_VERSION: '9.x'
1111
PROJECT_NAME: src/MinimalHelpers.Routing.Analyzers
1212
PROJECT_FILE: MinimalHelpers.Routing.Analyzers.csproj
1313
TAG_NAME: routing-analyzers

.github/workflows/publish_validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
env:
10-
NET_VERSION: '8.x'
10+
NET_VERSION: '9.x'
1111
PROJECT_NAME: src/MinimalHelpers.Validation
1212
PROJECT_FILE: MinimalHelpers.Validation.csproj
1313
TAG_NAME: validation

README.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,6 @@ dotnet add package MinimalHelpers.Routing
2424

2525
Create a class to hold your route handlers registration and make it implementing the `IEndpointRouteHandlerBuilder` interface:
2626

27-
**.NET 6.0**
28-
29-
```csharp
30-
public class PeopleEndpoints : MinimalHelpers.Routing.IEndpointRouteHandlerBuilder
31-
{
32-
public void MapEndpoints(IEndpointRouteBuilder endpoints)
33-
{
34-
endpoints.MapGet("/api/people", GetList);
35-
endpoints.MapGet("/api/people/{id:guid}", Get);
36-
endpoints.MapPost("/api/people", Insert);
37-
endpoints.MapPut("/api/people/{id:guid}", Update);
38-
endpoints.MapDelete("/api/people/{id:guid}", Delete);
39-
}
40-
41-
// ...
42-
}
43-
```
44-
45-
**.NET 7.0 or higher**
46-
4727
```csharp
4828
public class PeopleEndpoints : MinimalHelpers.Routing.IEndpointRouteHandlerBuilder
4929
{
@@ -60,9 +40,6 @@ public class PeopleEndpoints : MinimalHelpers.Routing.IEndpointRouteHandlerBuild
6040
}
6141
```
6242

63-
> **Note**
64-
Starting from .NET 7.0, the `IEndpointRouteHandlerBuilder` interface exposes the `MapEndpoints` method as static abstract, so it can be called without creating an instance of the handler.
65-
6643
Call the `MapEndpoints()` extension method on the **WebApplication** object inside *Program.cs* before the `Run()` method invocation:
6744

6845
```csharp
@@ -94,9 +71,7 @@ app.MapEndpoints(type =>
9471
> **Note**
9572
These methods rely on Reflection to scan the Assembly and find the classes that implement the `IEndpointRouteHandlerBuilder` interface. This can have a performance impact, especially in large projects. If you have performance issues, consider using the explicit registration method. Moreover, this solution is incompatibile with Native AOT.
9673

97-
If you're working with .NET 7.0 or higher, the reccommended approach is to use the **MinimalHelpers.Routing.Analyzers** package, that provides a Source Generator for endpoints registration, as described later.
98-
99-
## MinimalHelpers.Routing.Analyzers (.NET 7.0 or higher)
74+
## MinimalHelpers.Routing.Analyzers
10075

10176
[![Nuget](https://img.shields.io/nuget/v/MinimalHelpers.Routing.Analyzers)](https://www.nuget.org/packages/MinimalHelpers.Routing.Analyzers)
10277
[![Nuget](https://img.shields.io/nuget/dt/MinimalHelpers.Routing.Analyzers)](https://www.nuget.org/packages/MinimalHelpers.Routing.Analyzers)

samples/MinimalSample/MinimalSample.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.10.0" />
11-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
12-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
10+
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
12+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.1.0" />
13+
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.0.5" />
1314
</ItemGroup>
1415

1516
<ItemGroup>

0 commit comments

Comments
 (0)