Browse Source

Update GenHTTP to version 8 (#8563)

Andreas Nägeli 1 year ago
parent
commit
0243d0b616

+ 7 - 7
frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj

@@ -2,7 +2,7 @@
   
   <PropertyGroup>
     
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <LangVersion>10.0</LangVersion>
     
     <AssemblyTitle>GenHTTP Benchmarks</AssemblyTitle>
@@ -12,7 +12,7 @@
     <OutputType>Exe</OutputType>
     
     <ServerGarbageCollection>true</ServerGarbageCollection>
-	<TieredPGO>true</TieredPGO>
+	  <TieredPGO>true</TieredPGO>
     
   </PropertyGroup>
   
@@ -28,12 +28,12 @@
     
   <ItemGroup>
 	  
-    <PackageReference Include="GenHTTP.Core" Version="6.4.0" />
-    <PackageReference Include="GenHTTP.Modules.Razor" Version="6.4.0" />
-    <PackageReference Include="GenHTTP.Modules.Webservices" Version="6.4.0" />
+    <PackageReference Include="GenHTTP.Core" Version="8.0.0" />
+    <PackageReference Include="GenHTTP.Modules.Razor" Version="8.0.0" />
+    <PackageReference Include="GenHTTP.Modules.Webservices" Version="8.0.0" />
 	  
-    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
-    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
+    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
 	  
   </ItemGroup>
   

+ 1 - 1
frameworks/CSharp/genhttp/Benchmarks/Tests/FortuneHandler.cs

@@ -88,7 +88,7 @@ namespace Benchmarks.Tests
 
         public ValueTask<ulong> CalculateChecksumAsync() => new(17);
 
-        public IEnumerable<ContentElement> GetContent(IRequest request) => Enumerable.Empty<ContentElement>();
+        public IAsyncEnumerable<ContentElement> GetContentAsync(IRequest request) => AsyncEnumerable.Empty<ContentElement>();
 
         public ValueTask<string> RenderAsync(TemplateModel model) => Template.RenderAsync(model);
 

+ 2 - 1
frameworks/CSharp/genhttp/Benchmarks/Utilities/ServerHeaderConcern.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;
 
 using GenHTTP.Api.Content;
@@ -31,7 +32,7 @@ namespace Benchmarks.Utilities
 
         #region Functionality
 
-        public IEnumerable<ContentElement> GetContent(IRequest request) => Content.GetContent(request);
+        public IAsyncEnumerable<ContentElement> GetContentAsync(IRequest request) => Content.GetContentAsync(request);
 
         public ValueTask PrepareAsync() => Content.PrepareAsync();
 

+ 2 - 2
frameworks/CSharp/genhttp/genhttp.dockerfile

@@ -1,9 +1,9 @@
-FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
 
-FROM mcr.microsoft.com/dotnet/runtime:7.0 AS runtime
+FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
 ENV DOTNET_SYSTEM_NET_SOCKETS_INLINE_COMPLETIONS 1
 
 # Full PGO