Esempio n. 1
0
        public static bool IsAuthenticated(this HttpContext context)
        {
            IUserExtensions userExtensions = context.RequestServices.GetRequiredService <IUserExtensions>();

            return(userExtensions.IsAuthenticated(context.User));
        }
Esempio n. 2
0
 public UserRepository(IUserExtensions userExtensions)
 {
     _userExtensions = userExtensions;
 }
 public LessonsController(ApplicationDbContext context, UserManager <ApplicationUser> userManager,
                          RoleManager <IdentityRole> roleManager, SignInManager <ApplicationUser> signInManager, IUserExtensions userExtensions)
 {
     _context        = context;
     _userManager    = userManager;
     _roleManager    = roleManager;
     _signInManager  = signInManager;
     _userExtensions = userExtensions;
 }
Esempio n. 4
0
        public static string GetRole(this HttpContext context)
        {
            IUserExtensions userExtensions = context.RequestServices.GetRequiredService <IUserExtensions>();

            return(userExtensions.GetRole(context));
        }