Skip to content

Commit 8ce9545

Browse files
authored
Csharp/Reaper - Update to .NET 9 / Latest Version (#9432)
* Update reaper to latest version * Correct default log level
1 parent c0164be commit 8ce9545

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

frameworks/CSharp/reaper/reaper.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:8.0 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
22
WORKDIR /src
33
COPY src .
44
RUN apt-get update \
@@ -7,7 +7,7 @@ RUN apt-get update \
77
WORKDIR "/src/Benchmark"
88
RUN dotnet publish "Benchmark.csproj" -c Release -o /app/publish
99

10-
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
10+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
1111
WORKDIR /app
1212
EXPOSE 8080
1313
COPY --from=build /app/publish .

frameworks/CSharp/reaper/src/Benchmark/Benchmark.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Reaper.Core" Version="0.1.0-alpha.0.6" />
22-
<PackageReference Include="Reaper.SourceGenerator" Version="0.1.0-alpha.0.6" />
21+
<PackageReference Include="Reaper.Core" Version="0.1.0-alpha.0.43" />
22+
<PackageReference Include="Reaper.SourceGenerator" Version="0.1.0-alpha.0.43" />
2323
</ItemGroup>
2424

2525
</Project>

frameworks/CSharp/reaper/src/Benchmark/JsonEndpoint.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ public class JsonResponse
1111
[ReaperRoute(HttpVerbs.Get, "/json")]
1212
public class JsonEndpoint : ReaperEndpointXR<JsonResponse>
1313
{
14-
public override Task<JsonResponse> HandleAsync()
14+
public override Task ExecuteAsync()
1515
{
1616
Context.Response.ContentLength = 27;
17-
return Task.FromResult(new JsonResponse { Message = "Hello, World!" });
17+
Result = new JsonResponse { Message = "Hello, World!" };
18+
return Task.CompletedTask;
1819
}
1920
}

frameworks/CSharp/reaper/src/Benchmark/PlainTextEndpoint.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ namespace Benchmark;
66
[ReaperRoute(HttpVerbs.Get, "/plaintext")]
77
public class PlainTextEndpoint : ReaperEndpointXR<string>
88
{
9-
public override Task<string> HandleAsync()
9+
public override Task ExecuteAsync()
1010
{
1111
Context.Response.StatusCode = 200;
1212
Context.Response.ContentType = "text/plain";
1313
Context.Response.ContentLength = 13;
14-
return Task.FromResult("Hello, World!");
14+
Result = "Hello, World!";
15+
return Task.CompletedTask;
1516
}
1617
}
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
using System.Text.Json.Serialization;
2-
using Benchmark;
31
using Reaper;
42

53
var builder = WebApplication.CreateSlimBuilder(args);
64
builder.Logging.ClearProviders();
75
builder.Logging.Configure(o => o.ActivityTrackingOptions = ActivityTrackingOptions.None);
8-
builder.Services.ConfigureHttpJsonOptions(o =>
9-
{
10-
o.SerializerOptions.TypeInfoResolverChain.Insert(0, SourceGenerationContext.Default);
11-
});
126
builder.UseReaper();
137

148
var app = builder.Build();
159

1610
app.UseReaperMiddleware();
1711
app.MapReaperEndpoints();
1812

19-
app.Run();
20-
21-
[JsonSerializable(typeof(JsonResponse))]
22-
internal partial class SourceGenerationContext : JsonSerializerContext { }
13+
app.Run();

frameworks/CSharp/reaper/src/Benchmark/appsettings.Development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"Microsoft.AspNetCore": "Warning"
66
}
77
}
8-
}
8+
}

0 commit comments

Comments
 (0)