IoC: Castle Windsor and WebAPI

后端 未结 4 1140
甜味超标
甜味超标 2020-12-05 10:46

I have an MVC4 site using Castle Windsor that I want to add some WebAPI calls to, so I start digging around a little bit on the interwebs.

Now I don\'t know the ins

4条回答
  •  醉梦人生
    2020-12-05 11:36

    In order to use Windsor with webapi follow http://blog.ploeh.dk/2012/10/03/DependencyInjectioninASP.NETWebAPIwithCastleWindsor/ (BEH: fixed link)

    Read also Castle Windsor/DelegatingHandler/IPrincipal Dependency Injection (DI)/Inversion of Control (IoC) in ASP.NET Web API

    You can use webapi and MVC controllers in the same app (I prefer to keep it separate) but routing and controllers factory are different and you have to set up two different configuration and handle routing overlaps... For MVC & Windsor you can find a great

提交回复
热议问题