get current logged user in asp core contructor code example
Example 1: how get the user show mvc controller core 3.1
string userName = _httpContextAccessor.HttpContext.User.Identity.Name;
Example 2: how get the user show mvc controller core 3.1
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();