I am using Scrutor to register pipeline behaviours for MediatR which is working perfectly with the following code
builder.Services.Scan(scan => scan.FromAssemblyOf<Program>()
.AddClasses(cls => cls.AssignableTo(typeof(IPipelineBehavior<,>)))
.AsImplementedInterfaces()
.WithScopedLifetime()
);
I have now introduced a pipeline behaviour that I want to be run before the others. Pipeline execution order is set by the order they are registered with the container so now I need to either specify the registration order somehow or register them all manually.
Is there a way that I can specify the registration order (by using something like an attribute on the classes) or do I have to stop using Scrutor for this and register them all manually?
I am using Scrutor to register pipeline behaviours for MediatR which is working perfectly with the following code
I have now introduced a pipeline behaviour that I want to be run before the others. Pipeline execution order is set by the order they are registered with the container so now I need to either specify the registration order somehow or register them all manually.
Is there a way that I can specify the registration order (by using something like an attribute on the classes) or do I have to stop using Scrutor for this and register them all manually?