File tree Expand file tree Collapse file tree 6 files changed +24
-18
lines changed
frameworks/CSharp/fastendpoints Expand file tree Collapse file tree 6 files changed +24
-18
lines changed Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk.Web" >
2
2
3
3
<PropertyGroup >
4
- <TargetFramework >net8 .0</TargetFramework >
4
+ <TargetFramework >net9 .0</TargetFramework >
5
5
<Nullable >enable</Nullable >
6
6
<ImplicitUsings >enable</ImplicitUsings >
7
7
<NoWarn >CA2016;IDE1006</NoWarn >
Original file line number Diff line number Diff line change 1
1
namespace Benchmarks . Endpoints ;
2
2
3
- public sealed class JsonEndpoint : Endpoint < EmptyRequest , object >
3
+ sealed class JsonEndpoint : Ep . NoReq . Res < object >
4
4
{
5
5
public override void Configure ( )
6
6
{
7
7
Get ( "/json" ) ;
8
8
AllowAnonymous ( ) ;
9
9
}
10
10
11
- public override Task HandleAsync ( EmptyRequest _ , CancellationToken __ )
11
+ public override Task HandleAsync ( CancellationToken ct )
12
12
{
13
13
HttpContext . Response . ContentLength = 27 ;
14
+
14
15
return SendAsync ( new { message = "Hello, World!" } ) ;
15
16
}
16
17
}
Original file line number Diff line number Diff line change 1
1
namespace Benchmarks . Endpoints ;
2
2
3
- public sealed class PlainTextEndpoint : Endpoint < EmptyRequest , EmptyResponse >
3
+ sealed class PlainTextEndpoint : Ep . NoReq . Res < byte [ ] >
4
4
{
5
- private static readonly byte [ ] payload = System . Text . Encoding . UTF8 . GetBytes ( "Hello, World!" ) ;
5
+ static readonly byte [ ] _payload = "Hello, World!"u8 . ToArray ( ) ;
6
6
7
7
public override void Configure ( )
8
8
{
9
9
Get ( "/plaintext" ) ;
10
10
AllowAnonymous ( ) ;
11
11
}
12
12
13
- public override Task HandleAsync ( EmptyRequest _ , CancellationToken __ )
13
+ public override Task HandleAsync ( CancellationToken ct )
14
14
{
15
15
HttpContext . Response . StatusCode = StatusCodes . Status200OK ;
16
16
HttpContext . Response . ContentType = "text/plain" ;
17
- HttpContext . Response . ContentLength = payload . Length ;
18
- return HttpContext . Response . Body . WriteAsync ( payload , 0 , payload . Length ) ;
17
+ HttpContext . Response . ContentLength = _payload . Length ;
18
+
19
+ return HttpContext . Response . Body . WriteAsync ( _payload , 0 , _payload . Length ) ;
19
20
}
20
21
}
Original file line number Diff line number Diff line change 1
1
global using FastEndpoints ;
2
2
3
- var builder = WebApplication . CreateBuilder ( ) ;
4
- builder . Logging . ClearProviders ( ) ;
5
- builder . Services . AddFastEndpoints ( ) ;
3
+ var bld = WebApplication . CreateBuilder ( ) ;
4
+ bld . Logging . ClearProviders ( ) ;
5
+ bld . Services . AddFastEndpoints ( ) ;
6
6
7
- var app = builder . Build ( ) ;
7
+ var app = bld . Build ( ) ;
8
8
app . UseFastEndpoints ( ) ;
9
- app . Run ( "http://0.0.0.0:8080" ) ;
9
+ app . Run ( "http://0.0.0.0:8080" ) ;
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ This includes tests for plaintext and json serialization.
5
5
6
6
** Language**
7
7
8
- * C# 12 .0
8
+ * C# 13 .0
9
9
10
10
** Platforms**
11
11
12
- * .NET 8 (Windows and Linux)
12
+ * .NET 9 (Windows and Linux)
13
13
14
14
** Web Servers**
15
15
@@ -18,7 +18,7 @@ This includes tests for plaintext and json serialization.
18
18
** Web Stack**
19
19
20
20
* [ FastEndpoints] ( https://fast-endpoints.com/ )
21
- * ASP.NET 8
21
+ * ASP.NET 9
22
22
23
23
## Paths & Source for Tests
24
24
Original file line number Diff line number Diff line change 1
- FROM mcr.microsoft.com/dotnet/sdk:8 .0 AS build
1
+ FROM mcr.microsoft.com/dotnet/sdk:9 .0 AS build
2
2
WORKDIR /app
3
3
COPY Benchmarks .
4
4
RUN dotnet publish -c Release -o out
5
5
6
- FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
6
+ FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
7
+ ENV DOTNET_GCDynamicAdaptationMode=0
8
+ ENV DOTNET_ReadyToRun=0
9
+ ENV DOTNET_HillClimbing_Disable=1
10
+
7
11
WORKDIR /app
8
12
COPY --from=build /app/out ./
9
13
You can’t perform that action at this time.
0 commit comments