Injecting dependency into CustomAttribute using Castle Windsor

前端 未结 2 1751
渐次进展
渐次进展 2020-12-08 22:23

In my ASP.Net MVC application I have implemented a Custom ActionFilter to Authorize users.

I use CastleWindsor to provide dependency injection into all of the contro

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 23:07

    OK - this seems to be a duplicate of Database injection into a validation attribute with ASP MVC and Castle Windsor which has been answered.

    Also How do I use Windsor to inject dependencies into ActionFilterAttributes.

    Having read through the above, and the referenced articles - the key one for me is http://weblogs.asp.net/psteele/archive/2009/11/04/using-windsor-to-inject-dependencies-into-asp-net-mvc-actionfilters.aspx for anyone else who is interested.

提交回复
热议问题