Using Autofac as a service locator

前端 未结 3 1944
名媛妹妹
名媛妹妹 2021-01-07 22:34

I\'m using Autofac to handle dependency injection in my application. However, I have one component that does some reflection magic at runtime and I don\'t know at compile-ti

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-07 22:54

    In other cases, when your component is not created by using DI, you still can use the service locator pattern. The Common Service Locator library on CodePlex is perfect for the purpose.

提交回复
热议问题