简体   繁体   中英

One class implementing multiple interfaces using dependency injection

I don't have any code with me to show you guys, but all I need to know that does Dependency Injection work in a scenario where a class implements multiple interfaces.

I do know about a single interface implemented by multiple classes using Dependency Injection.

Yes.

Why wouldn't it? As long as the class implements the interface you need you shouldn't have to care what else the class happens to implement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM