Hi @Arshad Nazeer ,
What is 'container' in the file Program.cs
This is the Asp.net core built-in IoC container. The built-in IoC container also known as Dependency Injection (DI) Container, it is a programming framework that provides you with an automatic Dependency Injection of your components.
The DI Container is responsible for supporting automatic Dependency Injection. Its basic features include:
- Registration: the DI Container needs to know which type of object to create for a specific dependency; so, it provides a way to map a type to a class so that it can create the correct dependency instance.
- Resolution: this feature allows the DI Container to resolve a dependency by creating an object and injecting it into the requesting class. Thanks to this feature, you don't have to instantiate objects manually to manage dependencies.
- Disposition: the DI Container manages the lifetime of the dependencies following specific criteria.
More detail about using the Dependency injection, see Dependency injection in ASP.NET Core
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion