Update README with ASP.NET info.

This commit is contained in:
Kevin Matsubara 2025-04-08 23:03:37 +02:00
parent 56fd0e44e7
commit ba77fbd176

View File

@ -151,4 +151,11 @@ This is the least recommended method of loading data. It requires the [Microsoft
* A **Team** has one **Coach** (1:1)
* **Matches** are played by many **Teams** (M:M)
You can use [EF Core Power Tools](https://marketplace.visualstudio.com/items?itemName=ErikEJ.EFCorePowerTools) to create diagrams.
You can use [EF Core Power Tools](https://marketplace.visualstudio.com/items?itemName=ErikEJ.EFCorePowerTools) to create diagrams.
## ASP.NET Core with Entity Framework Core
A web application will make connection to the database on demand, which is a scoped connection. When not using the database, the web application is in a disconnected state.
You cannot create a new context in a file, because a new connection needs to be established every time and also closed, when the database is no longer needed. Also, *no tracking* is recommended, because multiple people can manipulate data.
An Inversion of Control (IoC) container will be used to handle dependancy injection for the DbContext. And also the DbContext will need a constructor with parameters to initialize itself properly.