_httpContextAccessor.HttpContext.User code example
Example 1: how get the user show mvc controller core 3.1
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
Example 2: how get the user show mvc controller core 3.1
private readonly IHttpContextAccessor _httpContextAccessor;
//constructor then
_httpContextAccessor = httpContextAccessor;