public void OnAuthorization(AuthorizationFilterContext context) { _sessao = (Sessao)context.HttpContext.RequestServices.GetService(typeof(Sessao)); var sessao = _sessao.Buscar("Acesso"); if (sessao != null) { context.Result = new RedirectToActionResult("Inicio", "Home", null); } }