Skip to content

Commit 0185a77

Browse files
Update .NET SDK
Update to a newer version of the preview 7 SDK that includes changes to support ClaimsPrincipal with minimal actions.
1 parent dbec32a commit 0185a77

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.100-preview.7.21354.4",
3+
"version": "6.0.100-preview.7.21356.1",
44
"allowPrerelease": false,
55
"rollForward": "latestMajor"
66
}

src/TodoApp/Program.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
33

44
using System.IO;
5-
using System.Security.Claims;
65
using Microsoft.AspNetCore.Builder;
76
using Microsoft.AspNetCore.Hosting;
8-
using Microsoft.AspNetCore.Http;
97
using Microsoft.EntityFrameworkCore;
108
using Microsoft.Extensions.Configuration;
119
using Microsoft.Extensions.DependencyInjection;
@@ -22,16 +20,6 @@
2220
builder.Services.AddScoped<ITodoRepository, TodoRepository>();
2321
builder.Services.AddScoped<ITodoService, TodoService>();
2422

25-
// TODO Remove if ClaimsPrincipal support is added to minimal actions.
26-
// See https://github.com/dotnet/aspnetcore/issues/33870
27-
// and https://github.com/dotnet/aspnetcore/pull/33883.
28-
builder.Services.AddHttpContextAccessor();
29-
builder.Services.AddScoped<ClaimsPrincipal>((p) =>
30-
{
31-
var context = p.GetRequiredService<IHttpContextAccessor>();
32-
return context.HttpContext!.User;
33-
});
34-
3523
builder.Services.AddGitHubAuthentication();
3624
builder.Services.AddHttpClient();
3725
builder.Services.AddRazorPages();

src/TodoApp/TodoApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010
<ItemGroup>
1111
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="6.0.0-preview.5.21319.40" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-preview.7.21329.1" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-preview.7.21351.1" />
1313
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.3.2" PrivateAssets="all" />
1414
<PackageReference Include="NodaTime" Version="3.0.5" />
1515
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.4" />

tests/TodoApp.Tests/TodoApp.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<FrameworkReference Include="Microsoft.AspNetCore.App" />
99
<PackageReference Include="JustEat.HttpClientInterception" Version="3.1.0" />
1010
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.1.1" />
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0-preview.7.21330.3" />
11+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0-preview.7.21355.4" />
1212
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
1313
<PackageReference Include="Microsoft.Playwright" Version="1.12.2" />
1414
<PackageReference Include="Shouldly" Version="4.0.3" />

0 commit comments

Comments
 (0)