core 3.1 get user in view code example
Example: how get the user show mvc controller core 3.1
string userName = _httpContextAccessor.HttpContext.User.Identity.Name;
string userName = _httpContextAccessor.HttpContext.User.Identity.Name;