2

I'm using Ninject to Inject my dependency in my Custom Authorize Attribute:

public class ValidatePermissionAttribute : AuthorizeAttribute, IAuthorizationFilter
{
    [Inject]
    public IUsuarioRepository UsuarioRepository { get; set; }
}

My module:

this.BindFilter<ValidatePermissionAttribute>(FilterScope.Global, null);

I'm trying to search some documentation about my question, but I don't find.

My Question is about the second parameter in BindFilter method: int? order. What does this mean?

All example I see have a 0 with parameter (Like this question Dependency Injection with Ninject and Filter attribute for asp.net mvc). But in my case the injection of property only works with null.

Community
  • 1
  • 1
Acaz Souza
  • 8,311
  • 11
  • 54
  • 97

1 Answers1

0

It defines the order in which the filters are executed. Filters with smaller values are executed first.

See http://bradwilson.typepad.com/blog/2010/07/service-location-pt4-filters.html about detailed information.

Remo Gloor
  • 32,665
  • 4
  • 68
  • 98