AspNetCore.Docs
AspNetCore.Docs copied to clipboard
Bridge pattern
I have a controller which take ISomething as dependency. There are already multiple classes implementing this interface. How can I control which concrete class in injected to the constructor of this controller? Thanks!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 08d2cf2e-55fb-33a4-b1d4-c97b2d531741
- Version Independent ID: f9a790d8-f25b-0e1d-eb63-c8ed3ac518cf
- Content: Dependency injection into controllers in ASP.NET Core
- Content Source: aspnetcore/mvc/controllers/dependency-injection.md
- Product: aspnet-core
- GitHub Login: @ardalis
- Microsoft Alias: riande
Hello! Thanks for contacting us. This sounds like a general question about using ASP.NET Core. While we try to look at and respond to all issues, for questions like this we recommend posting to a community support group like Stack Overflow with the asp.net-core tag.