Extend AuthorizeAttribute Override AuthorizeCore or OnAuthorization
问题 Using ASP.NET MVC I am creating a custom Authorize attribute to take care of some custom authorization logic. I have looked at a lot of examples and it is pretty straight forward but my question is which method is best to override, AuthorizeCore or OnAuthorization? I have seen many examples overriding one or the other. Is there a difference? 回答1: The clue is in the return types: AuthorizeCore returns a boolean - it is decision making code. This should be limited to looking at the user's