file-scoped namespaces

This commit is contained in:
2024-08-26 11:33:31 +03:00
parent bfce112a59
commit 0d8e30004d
56 changed files with 650 additions and 708 deletions

View File

@@ -2,12 +2,12 @@
using ApplicationLayer.InfrastructureServicesInterfaces;
using Microsoft.AspNetCore.Http;
namespace Infrastructure.Common
namespace Infrastructure.Common;
public class UserIdProvider(IHttpContextAccessor contextAccessor) : IUserIdProvider
{
public class UserIdProvider(IHttpContextAccessor contextAccessor) : IUserIdProvider
Guid IUserIdProvider.GetUserId()
{
Guid IUserIdProvider.GetUserId()
{
var claim = contextAccessor.HttpContext!.User.Claims.SingleOrDefault(claim => claim.Type == ClaimTypes.NameIdentifier);
if (claim is null)
{
@@ -15,5 +15,4 @@ namespace Infrastructure.Common
}
return Guid.Parse(claim.Value);
}
}
}
}