Content handlers resolved by Autofac are returned in an unpredicatable order. I need some content handlers to be invoked in a specific order.
Example:
Feature A
Content handler A -> assigns / removes role X from a user content item
Feature B
Content handler B -> evaluates assigned roles and when role X is found it and takes further actions
As you see, in my case it makes no sense to call handler B before A as role X must be updated in A before B can even execute further actions based on the role X assignment.
Currently Autofac resolves the handlers in an ordering as follows
..., A, B, ...
but the handlers are stored in the handler list in the following order
... B, A, ...
Then Orchard invokes the handlers like
Handlers.Invoke(handler => ..., Logger);
which obviously calls the handlers in the order
... B, A, ...
Is there anything i can do to ensure a specific order?
Here is a discussion in google groups about a similar issue: