Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frameworks/CSharp/reaper/reaper.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY src .
RUN apt-get update \
Expand All @@ -7,7 +7,7 @@ RUN apt-get update \
WORKDIR "/src/Benchmark"
RUN dotnet publish "Benchmark.csproj" -c Release -o /app/publish

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
WORKDIR /app
EXPOSE 8080
COPY --from=build /app/publish .
Expand Down
6 changes: 3 additions & 3 deletions frameworks/CSharp/reaper/src/Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand All @@ -18,8 +18,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Reaper.Core" Version="0.1.0-alpha.0.6" />
<PackageReference Include="Reaper.SourceGenerator" Version="0.1.0-alpha.0.6" />
<PackageReference Include="Reaper.Core" Version="0.1.0-alpha.0.43" />
<PackageReference Include="Reaper.SourceGenerator" Version="0.1.0-alpha.0.43" />
</ItemGroup>

</Project>
5 changes: 3 additions & 2 deletions frameworks/CSharp/reaper/src/Benchmark/JsonEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ public class JsonResponse
[ReaperRoute(HttpVerbs.Get, "/json")]
public class JsonEndpoint : ReaperEndpointXR<JsonResponse>
{
public override Task<JsonResponse> HandleAsync()
public override Task ExecuteAsync()
{
Context.Response.ContentLength = 27;
return Task.FromResult(new JsonResponse { Message = "Hello, World!" });
Result = new JsonResponse { Message = "Hello, World!" };
return Task.CompletedTask;
}
}
5 changes: 3 additions & 2 deletions frameworks/CSharp/reaper/src/Benchmark/PlainTextEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ namespace Benchmark;
[ReaperRoute(HttpVerbs.Get, "/plaintext")]
public class PlainTextEndpoint : ReaperEndpointXR<string>
{
public override Task<string> HandleAsync()
public override Task ExecuteAsync()
{
Context.Response.StatusCode = 200;
Context.Response.ContentType = "text/plain";
Context.Response.ContentLength = 13;
return Task.FromResult("Hello, World!");
Result = "Hello, World!";
return Task.CompletedTask;
}
}
11 changes: 1 addition & 10 deletions frameworks/CSharp/reaper/src/Benchmark/Program.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
using System.Text.Json.Serialization;
using Benchmark;
using Reaper;

var builder = WebApplication.CreateSlimBuilder(args);
builder.Logging.ClearProviders();
builder.Logging.Configure(o => o.ActivityTrackingOptions = ActivityTrackingOptions.None);
builder.Services.ConfigureHttpJsonOptions(o =>
{
o.SerializerOptions.TypeInfoResolverChain.Insert(0, SourceGenerationContext.Default);
});
builder.UseReaper();

var app = builder.Build();

app.UseReaperMiddleware();
app.MapReaperEndpoints();

app.Run();

[JsonSerializable(typeof(JsonResponse))]
internal partial class SourceGenerationContext : JsonSerializerContext { }
app.Run();
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"Microsoft.AspNetCore": "Warning"
}
}
}
}
Loading