var user = HttpContext.User; // Получение текущего пользователя var userId = user.FindFirstValue(ClaimTypes.NameIdentifier); // Получение идентификатора пользователя var role = user.FindFirstValue(ClaimTypes.Role); // Получение роли пользователяВ данном примере метод `FindFirstValue` применяется для поиска первого значения типа `ClaimTypes.NameIdentifier` (идентификатор пользователя) и `ClaimTypes.Role` (роль пользователя) в коллекции утверждений текущего пользователя. Полученные значения сохраняются в переменных `userId` и `role` соответственно.