Eligibility MustNotHaveAspectOfType
I want to have intellisense show a red squiggle under and attribute if it is added to a method that already has another attribute added.
I had assumed that MustNotHaveAspectOfType would fit the bill here but it seems I'm mistaken. What should I be using? Whilst we're on that subject can that eligibility be chained in an upwards direction. So for example if I apply a [NoLog] attribute to the class can I add build eligibility to a method aspect that would pick that up.? DeclaringType seems not be an option when applied to builder in the BuildEligibility override.
I had assumed that MustNotHaveAspectOfType would fit the bill here but it seems I'm mistaken. What should I be using? Whilst we're on that subject can that eligibility be chained in an upwards direction. So for example if I apply a [NoLog] attribute to the class can I add build eligibility to a method aspect that would pick that up.? DeclaringType seems not be an option when applied to builder in the BuildEligibility override.
5 Replies
It depends if the attribute is an aspect. If it is not, then MustNotHaveAspectOfType will not work and you have to test the presence of the custom attribute using the code model.
That makes sense, the aspect I'm looking for is essentially a blank [NoLog] job that inherits from Attribute not aspect.
@addabis Please file an enhancement to test the interface type and throw an exception if it's not an aspect type.
Filed an enhancement for this.
Thanks