Skip to content

Commit 9b2c2e9

Browse files
Upgrade aspnetcore to 6.0-rc1 (#6830)
* Upgrade aspnetcore to 6.0-rc1 * Update frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.cs Co-authored-by: Layomi Akinrinade <[email protected]> * Use camel case * Update csproj files Co-authored-by: Layomi Akinrinade <[email protected]>
1 parent f91556b commit 9b2c2e9

File tree

51 files changed

+496
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+496
-217
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31717.71
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlatformBenchmarks", "PlatformBenchmarks\PlatformBenchmarks.csproj", "{047A5FF4-56BB-4BEF-9DCF-9B6051365423}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Benchmarks\Benchmarks.csproj", "{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {69C5D834-F31B-4F07-97EC-E4DD5AF417DE}
30+
EndGlobalSection
31+
EndGlobal
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>net5.0</TargetFramework>
3+
<TargetFramework>net6.0</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66

@@ -12,11 +12,10 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.5" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.5" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0-rc.1.21452.10" />
1716

1817
<PackageReference Include="Dapper" Version="2.0.90" />
19-
<PackageReference Include="MySqlConnector" Version="1.3.2" />
20-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.2" />
18+
<PackageReference Include="MySqlConnector" Version="1.3.12" />
19+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0-rc.1" />
2120
</ItemGroup>
2221
</Project>

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesDapperMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class MultipleQueriesDapperMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryDapper));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2319

2420
private readonly RequestDelegate _next;
2521

@@ -37,7 +33,7 @@ public async Task Invoke(HttpContext httpContext)
3733
var db = httpContext.RequestServices.GetService<DapperDb>();
3834
var rows = await db.LoadMultipleQueriesRows(count);
3935

40-
var result = JsonConvert.SerializeObject(rows, _jsonSettings);
36+
var result = JsonSerializer.Serialize(rows, _serializerOptions);
4137

4238
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4339
httpContext.Response.ContentType = "application/json";

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesEfMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class MultipleQueriesEfMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryEf));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2319

2420
private readonly RequestDelegate _next;
2521

@@ -37,7 +33,7 @@ public async Task Invoke(HttpContext httpContext)
3733
var db = httpContext.RequestServices.GetService<EfDb>();
3834
var rows = await db.LoadMultipleQueriesRows(count);
3935

40-
var result = JsonConvert.SerializeObject(rows, _jsonSettings);
36+
var result = JsonSerializer.Serialize(rows, _serializerOptions);
4137

4238
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4339
httpContext.Response.ContentType = "application/json";

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesRawMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class MultipleQueriesRawMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryRaw));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2319

2420
private readonly RequestDelegate _next;
2521

@@ -37,7 +33,7 @@ public async Task Invoke(HttpContext httpContext)
3733
var db = httpContext.RequestServices.GetService<RawDb>();
3834
var rows = await db.LoadMultipleQueriesRows(count);
3935

40-
var result = JsonConvert.SerializeObject(rows, _jsonSettings);
36+
var result = JsonSerializer.Serialize(rows, _serializerOptions);
4137

4238
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4339
httpContext.Response.ContentType = "application/json";

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesDapperMiddleware.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class MultipleUpdatesDapperMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateDapper));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
23-
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2419
private readonly RequestDelegate _next;
2520

2621
public MultipleUpdatesDapperMiddleware(RequestDelegate next)
@@ -37,7 +32,7 @@ public async Task Invoke(HttpContext httpContext)
3732
var db = httpContext.RequestServices.GetService<DapperDb>();
3833
var rows = await db.LoadMultipleUpdatesRows(count);
3934

40-
var result = JsonConvert.SerializeObject(rows, _jsonSettings);
35+
var result = JsonSerializer.Serialize(rows, _serializerOptions);
4136

4237
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4338
httpContext.Response.ContentType = "application/json";

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesEfMiddleware.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class MultipleUpdatesEfMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateEf));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
23-
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2419
private readonly RequestDelegate _next;
2520

2621
public MultipleUpdatesEfMiddleware(RequestDelegate next)
@@ -37,7 +32,7 @@ public async Task Invoke(HttpContext httpContext)
3732
var db = httpContext.RequestServices.GetService<EfDb>();
3833
var rows = await db.LoadMultipleUpdatesRows(count);
3934

40-
var result = JsonConvert.SerializeObject(rows, _jsonSettings);
35+
var result = JsonSerializer.Serialize(rows, _serializerOptions);
4136

4237
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4338
httpContext.Response.ContentType = "application/json";

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesRawMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class MultipleUpdatesRawMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateRaw));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2319

2420
private readonly RequestDelegate _next;
2521

@@ -37,7 +33,7 @@ public async Task Invoke(HttpContext httpContext)
3733
var db = httpContext.RequestServices.GetService<RawDb>();
3834
var rows = await db.LoadMultipleUpdatesRows(count);
3935

40-
var result = JsonConvert.SerializeObject(rows, _jsonSettings);
36+
var result = JsonSerializer.Serialize(rows, _serializerOptions);
4137

4238
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4339
httpContext.Response.ContentType = "application/json";

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryDapperMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class SingleQueryDapperMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryDapper));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2319

2420
private readonly RequestDelegate _next;
2521

@@ -35,7 +31,7 @@ public async Task Invoke(HttpContext httpContext)
3531
var db = httpContext.RequestServices.GetService<DapperDb>();
3632
var row = await db.LoadSingleQueryRow();
3733

38-
var result = JsonConvert.SerializeObject(row, _jsonSettings);
34+
var result = JsonSerializer.Serialize(row, _serializerOptions);
3935

4036
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4137
httpContext.Response.ContentType = "application/json";

frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryEfMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Benchmarks.Configuration;
78
using Benchmarks.Data;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Http;
1011
using Microsoft.Extensions.DependencyInjection;
11-
using Newtonsoft.Json;
12-
using Newtonsoft.Json.Serialization;
1312

1413
namespace Benchmarks.Middleware
1514
{
1615
public class SingleQueryEfMiddleware
1716
{
1817
private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryEf));
19-
private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
20-
{
21-
ContractResolver = new CamelCasePropertyNamesContractResolver()
22-
};
18+
private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2319

2420
private readonly RequestDelegate _next;
2521

@@ -34,7 +30,7 @@ public async Task Invoke(HttpContext httpContext)
3430
{
3531
var db = httpContext.RequestServices.GetService<EfDb>();
3632
var row = await db.LoadSingleQueryRow();
37-
var result = JsonConvert.SerializeObject(row, _jsonSettings);
33+
var result = JsonSerializer.Serialize(row, _serializerOptions);
3834

3935
httpContext.Response.StatusCode = StatusCodes.Status200OK;
4036
httpContext.Response.ContentType = "application/json";

0 commit comments

Comments
 (0)