I have a child class AuthorizeAttribute named CheckArticleExistence.
I would like to set the attribute using the parameter that I get in the action. Like this:
[CheckArticleExistence(Id=articleId)]
public ActionResult Tags(int articleId)
{
...
}
I want to use articleId to check if this article exists in the database, and if it is not, I can run something else using the OnAuthorization method.
Is there any way? Thanks.
source
share