C# formatting

This commit is contained in:
2026-02-05 20:39:12 +01:00
parent 78cdbfe51e
commit c0756ff2c6
34 changed files with 830 additions and 582 deletions

View File

@@ -3,18 +3,11 @@ using Microsoft.AspNetCore.Authentication;
namespace GameList.Infrastructure;
public class EnsurePlayerExistsMiddleware
public class EnsurePlayerExistsMiddleware(RequestDelegate next)
{
private readonly RequestDelegate _next;
public EnsurePlayerExistsMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context, AppDbContext db)
{
if (context.User?.Identity?.IsAuthenticated == true)
if (context.User.Identity?.IsAuthenticated == true)
{
var id = context.User.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value;
if (string.IsNullOrWhiteSpace(id) || !Guid.TryParse(id, out var playerId) || await db.Players.FindAsync(playerId) is null)
@@ -25,6 +18,6 @@ public class EnsurePlayerExistsMiddleware
}
}
await _next(context);
await next(context);
}
}