0
Q:

how get the user show mvc controller core 3.1

string userName = _httpContextAccessor.HttpContext.User.Identity.Name;
0
public string LoggedInUser => User.Identity.Name;
0
private readonly IHttpContextAccessor _httpContextAccessor;
//constructor then
_httpContextAccessor = httpContextAccessor;
0
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
0

New to Communities?

Join the community