How to configure DI in .NET
Mar 8, 2023
In .NET 6, there are some major changes that focused around cleaner code. With ASP.NET Core web application that target . NET 6 and beyond, you’re able to add the configuration to the Program.cs without the need for the Startup.cs.
Firstly, you need to ensure that each class inherits an Interface and contains the members you wish to use.