can you inject dependencies into postsharp attribute using structure map
I use structure map for dependencies injection, I also now want to use postsharp for some authorisation checking at my service layer. because my service layer has all injected repositories is there a way I can inject or pass these reposito开发者_StackOverflow中文版ries to the postsharp attribute to query the sql and provide authorisation?
I've never used PostSharp - does the code in the PostSharp attributes execute at runtime, or during a post-compile pre-runtime stage?
If the code executes at runtime, you should be able to do service location using a static gateway (ObjectFactory.GetInstance).
精彩评论