AspNetCore.Docs
AspNetCore.Docs copied to clipboard
Set default type of resolving dependency injection of an interface.
With default service container, is there a way to set the default type when resolving dependency injection of an interface, like what's in the Autofac sample in the above?
builder.RegisterType<CharacterRepository>().As<ICharacterRepository>();
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 0d78f540-81fd-1ba9-cb90-591e4ec27d9b
- Version Independent ID: 2251f557-dd3a-ec35-2558-6243337db009
- Content: Dependency injection in ASP.NET Core
- Content Source: aspnetcore/fundamentals/dependency-injection.md
- Product: aspnet-core
- GitHub Login: @guardrex
- Microsoft Alias: riande
I don't think so.