Refactor UserId property handling and clean up Protobuf file formatting

This commit is contained in:
masoodafar-web
2025-11-21 04:19:33 +03:30
parent 447625079c
commit 724f7a2348
3 changed files with 72 additions and 72 deletions

View File

@@ -13,7 +13,7 @@ public class CurrentUserService : ICurrentUserService
_httpContextAccessor = httpContextAccessor;
}
public long? UserId => long.Parse(_httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.NameIdentifier)) ;
public long? UserId =>_httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.NameIdentifier)==null?null: long.Parse(_httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.NameIdentifier)) ;
public string? FirstName => _httpContextAccessor.HttpContext?.User?.FindFirstValue("FirstName");
public string? LastName => _httpContextAccessor.HttpContext?.User?.FindFirstValue("LastName");
public string? MobileNumber => _httpContextAccessor.HttpContext?.User?.FindFirstValue("MobileNumber");