httpcontext.current.user in .net core 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;