Рет қаралды 21,991
This tutorial would help you set up your Mac to run ASP.NET Core web apps with SQL Server, using Docker and Microsoft Visual Studio 2022 as the IDE.
PREVIOUS DETAILED VIDEO TUTORIAL WITH JETBRAINS RIDER:
• SQL Server + Jetbrains...
DETAILED TEXT TUTORIAL:
gist.github.com/rungxanh1995/...
TIME STAMPS:
0:00 Intro
1:36 Download & Install Docker
2:07 Configure Docker
3:05 Pull Sql Server Docker image
4:16 Run Sql Server Docker image
5:30 Install Visual Studio 2022
6:20 Configure your ASP.NET Core project
8:45 Edit "appsettings.json" connection string
10:53 Update database with EF Core CLI
13:00 EXTRA: Solve duplicated database tables
COMMANDS TO COPY:
* Pull Docker image
⬇️ For M1 Mac
docker pull mcr.microsoft.com/azure-sql-edge:latest
⬇️ For Intel Mac
docker pull microsoft/mssql-server-linux
* Run Docker image
⬇️ For M1 Mac
docker run -d --name ms-sql-server -e "ACCEPT_EULA=Y" -e 'SA_PASSWORD=Docker@123' -p 1433:1433 mcr.microsoft.com/azure-sql-edge:latest
⬇️ For Intel Mac
docker run -d --name ms-sql-server 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Docker@123' -p 1433:1433 microsoft/mssql-server-linux
* Connection string for "appsettings.json"
Server=localhost;Database="database_name";User=sa;Password=Docker@123;
-- where you would replace "database_name" (including the double quotes) with a specific name for your database (duh!)
-- this would fix a potential migration-related database issue I mentioned at 13:00
* Update database with EF CLI tool
dotnet ef database update
*** CREDITS to original tutorial by Valuetech Company
• How to install SQL Ser...