ASMX Dependency Injection and IoC

后端 未结 2 1617
有刺的猬
有刺的猬 2021-02-02 12:20

So i have gotten stuck while trying to get my asmx webservice to use dependency injection and using an IoC to do it. I want my webservice to be able to use my internal business

2条回答
  •  心在旅途
    2021-02-02 12:42

    You can only have a parameter-less constructor on a WebService. However, what you could do, is have a property on the WebService class, and inside of the parameter-less constructor call something like _myDependency = container.resolve();

提交回复
热议问题