public static bool IsAuthenticated(this HttpContext context) { IUserExtensions userExtensions = context.RequestServices.GetRequiredService <IUserExtensions>(); return(userExtensions.IsAuthenticated(context.User)); }
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; }
public static string GetRole(this HttpContext context) { IUserExtensions userExtensions = context.RequestServices.GetRequiredService <IUserExtensions>(); return(userExtensions.GetRole(context)); }