I have Controller
in my project asp.net (Web Service) I need to do a token check to request each method. One solution I found is to create a static method and place a call at the beginning of each method. I could only put it once in the constructor of my Controller
but that's the problem: not all methods need this verification.
So I would like to know how to implement an Annotations with the implementation of my verification and use Annotations to validate these requests. If the request is invalid, the request is sent to a 404 page.
I would like a horizon of how to do this, something like this pseudo-code below:
@VerificationToken
public List<Produto> getAllProducts(){
// implementação
}