What is the Order = parameter in the Authorize attribute?

1

What is the Order parameter in the Asp.NET Authorization%% Attribute?

How do you use it?

    
asked by anonymous 14.10.2014 / 17:55

1 answer

2

According to the MSDN , it indicates the order in which the attribute will run, from the filters that are configured in the pipeline of the MVC ( IMvcFilter ). If the only filter you have is [Authorize] , then the value of the attribute does not matter. If you have more than one, then it can set the order that the authorization logic will be executed.

For example, if you have a filter that logs all requests to your controller. If the order of the authorization attribute causes it to run before the logger , then rejected requests will not be logged in ; otherwise they will be logged in.

    
14.10.2014 / 18:21