Métodos Frequentes
Métodos Frequentes
Métodos Frequentes
Métodos Frequentes
public void OnAuthorization(AuthorizationContext filterContext) { var url = new UrlHelper(filterContext.RequestContext); var adminUser = filterContext.HttpContext.User as AdminUser; if (adminUser == null || !adminUser.Identity.IsAuthenticated) { var requestUrl = filterContext.HttpContext.Request.RawUrl.ToLower(); var loginUrl = url.AdminLogin(requestUrl); filterContext.Result = new RedirectResult(loginUrl); } }