How to Create ASP.NET Core 3.0 React SPA with Secure Membership using MySQL Database in 20 Minutes
Feb 16, 2022
This tutorial uses .NET Core 3.0. Also proven to work on .NET Core 3.1 as well!
The web app has React as front end, MySQL as Database layer where the ASP.NET Identity Server 4 membership related schema will be migrated to.
Detailed Article: https://bit.ly/2zPN385
Full Code on Github Repo : http://bit.ly/2LWgacA
00:00 Introduction
00:55 Create ASP.NET Core ]Project
02:03 Configure Project creation with React & Authentication
03:19 Delete MSSQL Server Database Migrations Directory
04:10 Uninstall Microsoft.EntityFrameworkCore.SQLServer
04:40 Install Pomelo.EntityFrameworkCore.MySql
05:50 Update all NuGet package dependencies
06:53 Update appsettings.json Connection String for MySQL database
09:07 Update Startup.CS file to use to MySQL
10:10 Build the solution
11:26 Pre-checks before creating migrations or MySQL
12:11 Add Migration to create Membership Schema scripts for MySQL
13:13 Update Database to have ASP.NET Core Membership tables in MySQL
14:07 Verify MySQL database for membership tables
14:35 Run the application
15:24 Register user and login to application
18:09 Verify for Registered User in MySQL database
20:08 Summary
Pre-Requisites
Microsoft Visual Studio 2019 Community Edition
.net core 3 https://dotnet.microsoft.com/download/dotnet-core
MySQL Tools for Visutal Studio https://dev.mysql.com/downloads/windows/visualstudio/
mysql-for-visualstudio-1.2.9.msi (https://dev.mysql.com/downloads/windows/visualstudio/)
Configurating ASP.NET Membership web app for MySQL
Step 1:
Delete Migrations Directory under the Data Directory
Step 2:
Uninstall the package Microsoft.EntityFrameworkCore.SQLServer Install the package Pomelo.EntityFrameworkCore.MySql
Step 3:
Create db in MySql
CREATE SCHEMA reactmembership;
Step 4:
Update value of DefaultConnection in appsettings.json to
server=localhost;port=3306;database=reactmembership;user=root;password=p@$$w0Rd;CharSet=utf8
Step 5:
In Startup.cs file update ConfigureServices method to replace UseSqlServer with UseMySql
Step 6:
Tools -~ Nuget Package Manager -~ Package Manager Console
In Visual Studio, use the Package Manager Console to scaffold a new migration and apply it to the database:
Add-Migration [migration name]
Update-Database
#dotnetcore3 #mysql #IdentityServer4 #aspnet #dotnet #reactjs #authentication #mysqlauthentication
------------------------------------------------------------------------------------------------
πππ
±ππ
²ππ
Έπ
±π
΄ to ππππ
»π
Έπ
½π
Ίπ channel if you like the content.
πππ
±ππ
²ππ
Έπ
±π
΄: http://bit.ly/2Y0ZunB
Share this video with your friends and colleagues and let them know you are upto date with latest tech-trends
Follow us:
Facebook: http://bit.ly/2Djmd6l
Twitter: http://bit.ly/2Ol9ZQT
Instagram: http://bit.ly/2pV4cYY
Support:
(Appreciate your Generosity: πΈ)
PayPal: http://bit.ly/2NZgVma
ETH: 0x0689Ecd747d6F4eA9CE491aD0b1734fEe62b2229
Show More Show Less 