Пример #1
0
 public HomeController(IProfessorRepository professorRepository, IAlunoRepository alunoRepository, ITreinoRepository treinoRepository, IHistoricoExercicioRepository historicoExercicioRepository, LoginProfessor loginProfessor)
 {
     _professorRepository          = professorRepository;
     _alunoRepository              = alunoRepository;
     _treinoRepository             = treinoRepository;
     _historicoExercicioRepository = historicoExercicioRepository;
     _loginProfessor = loginProfessor;
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
 public HomeController(LoginProfessor loginProfessor)
 {
     _loginProfessor = loginProfessor;
 }
Пример #4
0
 public ProfessorController(IProfessorRepository professorRepository, LoginProfessor loginProfessor)
 {
     _professorRepository = professorRepository;
     _loginProfessor      = loginProfessor;
 }