Registering a type as an interface and as self with ASP.NET Core dependency injection
Read OriginalThis technical article addresses a common issue in ASP.NET Core dependency injection: registering a service so it can be resolved both by its interface (e.g., ICustomerService) and its concrete type (e.g., DefaultCustomerService). It explains the problem, the resulting InvalidOperationException, and critiques common workarounds before hinting at a cleaner solution for registering types 'as self'.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser