You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Priority method overrides the order of decorators registrations. This is still globally ordering the decorators and one cannot customize it per implementations, right?
And there are three other decorators implementing the ICommand<T> and with .When.MeetsCondition, an example discussed earlier, they have been customized to be created on the existence of the corresponding attribute on top of the implementations. Is there any way that the order of decorators being based on the order of attributes? For instance, when creating decorators for FirstCommand the order be Audit -> Log but for the SecondCommand it should be the other way: Database -> Log -> Audit.
Sadly attribute order is not preserved as part of the language specification.
"The order in which attributes are specified in such a list, and the order in which sections attached to the same program entity are arranged, is not significant. For instance, the attribute specifications [A][B], [B][A], [A,B], and [B,A] are equivalent."
Activity
adding priority for fluent decorators issue #255
ipjohnson commentedon Apr 4, 2020
This is implemented
shahabganji commentedon Apr 5, 2020
@ipjohnson thanks for this feature 🙏
Prioritymethod overrides the order of decorators registrations. This is still globally ordering the decorators and one cannot customize it per implementations, right?Consider the following rare scenario:
And there are three other decorators implementing the
ICommand<T>and with.When.MeetsCondition, an example discussed earlier, they have been customized to be created on the existence of the corresponding attribute on top of the implementations. Is there any way that the order of decorators being based on the order of attributes? For instance, when creating decorators forFirstCommandthe order beAudit -> Logbut for theSecondCommandit should be the other way:Database -> Log -> Audit.is it at all possible and reasonable?
Thanks.
ipjohnson commentedon Apr 5, 2020
Sadly attribute order is not preserved as part of the language specification.
"The order in which attributes are specified in such a list, and the order in which sections attached to the same program entity are arranged, is not significant. For instance, the attribute specifications [A][B], [B][A], [A,B], and [B,A] are equivalent."