From ba77fbd176ea7d124cc5a6cb1a59a36f0deb3c8a Mon Sep 17 00:00:00 2001 From: Kevin Matsubara Date: Tue, 8 Apr 2025 23:03:37 +0200 Subject: [PATCH] Update README with ASP.NET info. --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e62dee..adbe381 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +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.