Summary Files Commits Branches @commit @diff @stats
path: root / src / tutorials / connect-to-mysql-in-csharp-ef
diff options
context:
space:
mode:
Commit217bc02d0cd6d3498a2764b2a4680842800dbe6a (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-02-27 11:07:34 +0200
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-02-27 11:07:34 +0200
Files9ca93886a5f5aecbf6d98abc9c6ec64b0c12feb4 /src/tutorials/connect-to-mysql-in-csharp-ef
syndamia.com-217bc02d0cd6d3498a2764b2a4680842800dbe6a.tar
syndamia.com-217bc02d0cd6d3498a2764b2a4680842800dbe6a.tar.gz
syndamia.com-217bc02d0cd6d3498a2764b2a4680842800dbe6a.zip
Parent36333c0f8eb1c78260e43169e508c8c8574d50e1 (diff)
Added links to all headings
diff --git a/src/tutorials/connect-to-mysql-in-csharp-ef/connecting.md b/src/tutorials/connect-to-mysql-in-csharp-ef/connecting.md
index 9292bd5..6f05a76 100644
--- a/src/tutorials/connect-to-mysql-in-csharp-ef/connecting.md
+++ b/src/tutorials/connect-to-mysql-in-csharp-ef/connecting.md
@@ -1,4 +1,5 @@
# Connect to MySql in C# and Entity Framework - Connecting
+[🔗](#Connect%20to%20MySql%20in%20C#%20and%20Entity%20Framework%20-%20Connecting)
**Article Created: 21 May 2020** || **Last Edited: 25 November 2020**
@@ -7,6 +8,7 @@
---
## Connection string
+[🔗](#Connection%20string)
You can find a truckload of ways to make your connection string from places like [this](https://www.connectionstrings.com/mysql/) but in this case, I've found out that most don't work.
After a lot of trial and error, I've found that this one works the best:
@@ -20,6 +22,7 @@ If you are using `MySQL Workbench` and you don't know your port and id, you can
![MyServer root 127.0.0.1:3306](./img/connections.png) In this example, the user id is _root_ and the port is _3306_.
## ASP.NET Startup
+[🔗](#ASP.NET%20Startup)
If you are making an `ASP.NET` application, you'll need to put the connection string in the `ConfigureServices` method of the `Startup.cs` file.
@@ -41,6 +44,7 @@ public void ConfigureServices(IServiceCollection services)
```
## DBContext child class
+[🔗](#DBContext%20child%20class)
If you want to connect a `DBContext` child class to a `MySQL` database, one of the easiest ways to do it, is to override the `OnConfiguring` method.
diff --git a/src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md b/src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md
index e2e882a..b17c772 100644
--- a/src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md
+++ b/src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md
@@ -1,4 +1,5 @@
# Connect to MySql in C# and Entity Framework - Introduction
+[🔗](#Connect%20to%20MySql%20in%20C#%20and%20Entity%20Framework%20-%20Introduction)
**Article Created: 21 May 2020** || **Last Edited: 25 November 2020**
@@ -9,6 +10,7 @@
In my experience, connecting a `C#` application to a `MySQL` database with Entity Framework can be quite tricky. Here, I share what works for me.
## Contents
+[🔗](#Contents)
1. [Introduction](./introduction.html)
2. [Preparation](./preparation.html)
diff --git a/src/tutorials/connect-to-mysql-in-csharp-ef/preparation.md b/src/tutorials/connect-to-mysql-in-csharp-ef/preparation.md
index 2736b51..4383454 100644
--- a/src/tutorials/connect-to-mysql-in-csharp-ef/preparation.md
+++ b/src/tutorials/connect-to-mysql-in-csharp-ef/preparation.md
@@ -1,4 +1,5 @@
# Connect to MySql in C# and Entity Framework - Preparation
+[🔗](#Connect%20to%20MySql%20in%20C#%20and%20Entity%20Framework%20-%20Preparation)
**Article Created: 21 May 2020** || **Last Edited: 25 November 2020**
@@ -7,10 +8,12 @@
---
## MySql
+[🔗](#MySql)
This tutorial doesn't cover it, but you'll need to have properly [installed and configured](https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/) `MySQL`.
## NuGet packages
+[🔗](#NuGet%20packages)
You'll need to install two NuGet packages: [Microsoft.EntityFrameworkCore](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore) and [MySql.Data.EntityFrameworkCore](https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/).