public HomeController(IProfessorRepository professorRepository, IAlunoRepository alunoRepository, ITreinoRepository treinoRepository, IHistoricoExercicioRepository historicoExercicioRepository, LoginProfessor loginProfessor) { _professorRepository = professorRepository; _alunoRepository = alunoRepository; _treinoRepository = treinoRepository; _historicoExercicioRepository = historicoExercicioRepository; _loginProfessor = loginProfessor; }
public void OnAuthorization(AuthorizationFilterContext context) { _loginProfessor = context.HttpContext.RequestServices.GetService(typeof(LoginProfessor)) as LoginProfessor; Professor professorLogado = _loginProfessor.Obter(); if (professorLogado == null) { context.Result = new RedirectToActionResult("login", "home", null); } }
public HomeController(LoginProfessor loginProfessor) { _loginProfessor = loginProfessor; }
public ProfessorController(IProfessorRepository professorRepository, LoginProfessor loginProfessor) { _professorRepository = professorRepository; _loginProfessor = loginProfessor; }