From f5c9f6a0bf77bb9acdf80aded94e0396f0355794 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 24 May 2020 17:17:03 +0300 Subject: Added title attributes for GitHub, StackOverflow and Back. Gave all class attributes quotes. Did some minor modifications. --- .../connect-to-mysql-in-csharp-ef/connecting.html | 54 +++++++++++----------- .../introduction.html | 36 +++++++-------- .../connect-to-mysql-in-csharp-ef/preparation.html | 42 ++++++++--------- website/tutorials/index.html | 32 ++++++------- 4 files changed, 82 insertions(+), 82 deletions(-) (limited to 'website/tutorials') diff --git a/website/tutorials/connect-to-mysql-in-csharp-ef/connecting.html b/website/tutorials/connect-to-mysql-in-csharp-ef/connecting.html index 5ebf9f8..2f528a6 100644 --- a/website/tutorials/connect-to-mysql-in-csharp-ef/connecting.html +++ b/website/tutorials/connect-to-mysql-in-csharp-ef/connecting.html @@ -9,29 +9,29 @@ -
-
Connect to MySql in C# and Entitiy Framework
+
+
Connect to MySql in C# and Entitiy Framework
- Introduction - Preparation - Connecting + Introduction + Preparation + Connecting - Back + Back
-
+

Connection string

- You can find many ways to impliment your connection string from here. + You can find many ways to impliment your connection string from here. From experience, this one works the best:
-

+

"server=localhost; port=YOUR-PORT; user id=YOUR-USER-ID; password=YOUR-PASSWORD; database=NAME-OF-DATABASE; SslMode=none"

If you don't know your port or user id, just look at the connection you use to connect to the database.

-

- MyServer root 127.0.0.1:3306 - +

+ MyServer root 127.0.0.1:3306 + In this example, the user id is root and the port is 3306.

@@ -42,7 +42,7 @@

Your ConfigureServices method should currenly look something like this: -

+

 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
@@ -54,16 +54,16 @@   });
 }

- You need to change .UseSQL to .UseMySQL (refer to preparations if you haven't already). + You need to change .UseSQL to .UseMySQL (refer to preparations if you haven't already).


DBContext child class

- If you want to connect a DBContext child class to a MySQL databse, the best way is to override the OnConfiguring method. In the override, in optionsBuilder, call the .UseMySQL method (refer to preparations if you haven't already). + If you want to connect a DBContext child class to a MySQL databse, the best way is to override the OnConfiguring method. In the override, in optionsBuilder, call the .UseMySQL method (refer to preparations if you haven't already).

Example: -

+

 protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
 {
  optionsBuilder.UseMySQL(DataBaseContexts.ConnectionStringMySQL);
@@ -74,21 +74,21 @@
-