开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜