42

.NET Core中的一个接口多种实现的依赖注入与动态选择看这篇就够了 - 依乐祝

 5 years ago
source link: https://www.cnblogs.com/yilezhu/p/10236163.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
最近有个需求就是一个抽象仓储层接口方法需要SqlServer以及Oracle两种实现方式,为了灵活我在依赖注入的时候把这两种实现都给注入进了依赖注入容器中,但是在服务调用的时候总是获取到最后注入的那个

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK