i'm working on asp.net core and i don't understand some things. for example in mvc.net 5 we can filter and authorize action with create class from AuthorizeAttribute and set attribute to actions like this:
public class AdminAuthorize : AuthorizeAttribute {
public override void OnAuthorization(AuthorizationContext filterContext) {
base.OnAuthorization(filterContext);
if (filterContext.Result is HttpUnauthorizedResult)
filterContext.Result = new RedirectResult("/Admin/Account/Login");
}
}
but in asp.net core we don't have AuthorizeAttribute ... how can i set filter like this in asp.net core for custom actions ?