Skip to content

epicodus-lessons/section-3-to-do-list-with-mysqlconnector-csharp-net6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What Is This?

This is an example repo corresponding to multiple lessons within the LearnHowToProgram.com walkthrough on creating a To Do List application in Section 3: Database Basics.

This project corresponds to the classwork and lessons that describe how to connect an ASP.NET Core MVC project to a MySQL database using the MySqlConnector package. Here are the lessons in the series:

How To Run This Project

Install Tools

Install the tools that are introduced in this series of lessons on LearnHowToProgram.com.

Set up the Databases

Follow the instructions in the LearnHowToProgram.com lesson "Introduction to MySQL Workbench: Creating a Database" to create a to_do_list_with_mysqlconnector database with an items table.

Next, follow the instructions in the LearnHowToProgram.com lesson "Creating a Test Database: Exporting and Importing Databases with MySQL Workbench" to create a to_do_list_with_mysqlconnector_test database with an items table.

Set Up and Run Project

  1. Clone this repo.
  2. Open the terminal and navigate to this project's production directory called "ToDoList".
  3. Within the production directory "ToDoList", create a new file called appsettings.json.
  4. Within appsettings.json, put in the following code, replacing the uid and pwd values with your own username and password for MySQL. For the LearnHowToProgram.com lessons, we always assume the uid is root and the pwd is epicodus.
{
  "ConnectionStrings": {
      "DefaultConnection": "Server=localhost;Port=3306;database=to_do_list_with_mysqlconnector;uid=root;pwd=epicodus;",
      "TestConnection": "Server=localhost;Port=3306;database=to_do_list_with_mysqlconnector_test;uid=root;pwd=epicodus;"
  }
}
  1. Within the production directory "ToDoList", run dotnet watch run in the command line to start the project in development mode with a watcher.
  2. Open the browser to https://localhost:5001. If you cannot access localhost:5001 it is likely because you have not configured a .NET developer security certificate for HTTPS. To learn about this, review this lesson: Redirecting to HTTPS and Issuing a Security Certificate.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published