How to get loggedin user name using this constructor of ApplicationDbContext, using ILoggedInUserService loggedInUserService
public ApplicationDbContext(DbContextOptions
: base(options)
{
_loggedInUserService = loggedInUserService;
}
Please do tell if anyone knew regarding this.
Paul AwomiPosted Oct 4, 2022, 6:24 AM
You can even get the username of the logged in user without using the constructor by simply writing the following line of codes:
string username = User.Identity.Name;