Aspect with dependencies and arguments #199
Unanswered
jakublabno
asked this question in
Q&A
Replies: 1 comment
-
It is exactly how it works. Merging attributes and aspects is just complimentary feature. Basically you make your aspect like this: [Aspect(Scope.Global, Factory = typeof(MyFactory))]
public class Aspect{
... here are your advices
} and Attribute like this: [Injection(typeof(Aspect))]
public class MyAttributeWithArgs{
public string Text {get;set;}
} and then follow this discussion on how to use it with DI |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Is there any way to have Attribute and Aspect logic seperated into different classes?
The case is I want dependencies to be injected into aspect, but also I want my aspect Attribute accepts arguments.
By using factory it's not possible since arguments to attributes are being pass through constructor.
example
I want to read this attribute in my aspect definition class where I have also another dependencies. Factory method is not applicable to this.
I saw that I can use static factory, but I need my dependencies that were created in Startup class.
#166
Beta Was this translation helpful? Give feedback.
All reactions