diff options
Compacted Connect to MySQL in CSharp tutorial into one page
3 files changed, 27 insertions, 42 deletions
| -rw-r--r-- | src/tutorials/connect-to-mysql-in-csharp-ef/article.md (renamed from src/tutorials/connect-to-mysql-in-csharp-ef/connecting.md) | 31 | ||||
| -rw-r--r-- | src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md | 16 | ||||
| -rw-r--r-- | src/tutorials/connect-to-mysql-in-csharp-ef/preparation.md | 22 |
diff --git a/src/tutorials/connect-to-mysql-in-csharp-ef/connecting.md b/src/tutorials/connect-to-mysql-in-csharp-ef/article.md index d347216..9067faa 100644 --- a/src/tutorials/connect-to-mysql-in-csharp-ef/connecting.md +++ b/src/tutorials/connect-to-mysql-in-csharp-ef/article.md @@ -1,11 +1,35 @@ -# Connecting - Connect to MySql in C# and Entity Framework +# Connect to MySql in C# and Entity Framework **Article Created: 21 May 2020** || **Last Edited: 25 November 2020** -[`<<`](./introduction.html) || [`< Preparations`](./preparation.html) - --- +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. [Preparation](#Preparation)) +2. [Connecting](#Connecting) + +# Preparation + +## 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/). + +[Microsoft.EntityFrameworkCore](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore) is the [object-relational mapping](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping) implementation we'll be using. It doesn't offer the specifics for connecting to a `MySQL` database, but it does everything else. + +[MySql.Data.EntityFrameworkCore](https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/) is what enables Microsoft.EntityFrameworkCore to connect to a `MySQL` database. + +# Connecting + ## Connection string [](#Connection%20string) @@ -57,4 +81,3 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) ``` Et voilà ! You should now be connected. - diff --git a/src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md b/src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md deleted file mode 100644 index 31de505..0000000 --- a/src/tutorials/connect-to-mysql-in-csharp-ef/introduction.md +++ /dev/null @@ -1,16 +0,0 @@ -# Introduction - Connect to MySql in C# and Entity Framework - -**Article Created: 21 May 2020** || **Last Edited: 25 November 2020** - -[`Preparation >`](./preparation.html) - ---- - -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) -3. [Connecting](./connecting.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 deleted file mode 100644 index e9f5d96..0000000 --- a/src/tutorials/connect-to-mysql-in-csharp-ef/preparation.md +++ /dev/null @@ -1,22 +0,0 @@ -# Preparation - Connect to MySql in C# and Entity Framework - -**Article Created: 21 May 2020** || **Last Edited: 25 November 2020** - -[`< Introduction`](./introduction.html) || [`Connecting >`](./connecting.html) - ---- - -## 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/). - -[Microsoft.EntityFrameworkCore](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore) is the [object-relational mapping](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping) implementation we'll be using. It doesn't offer the specifics for connecting to a `MySQL` database, but it does everything else. - -[MySql.Data.EntityFrameworkCore](https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/) is what enables Microsoft.EntityFrameworkCore to connect to a `MySQL` database. - |