mkdir entity-framework
cd entity-framework
dotnet new mvc
git init
git add .
git commit -m "Iniciando projeto"
code .gitignore # gerei o conteúdo para ignorar como (Windows, Linux, Mac, DotnetCore, VisualStudioCore) no link: https://www.toptal.com/developers/gitignore
Criei o repositório e rodei os comandos
git remote add origin git@github.com:torneseumprogramador/entity-framework.git
git branch -M main
git push -u origin main
dotnet add package Microsoft.EntityFrameworkCore --version 5.0.8
dotnet add package Microsoft.EntityFrameworkCore.Tools --version 5.0.8
dotnet add package Pomelo.EntityFrameworkCore.MySql --version 5.0.1
sudo apt install mysql-server
sudo mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
CREATE USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1';
FLUSH PRIVILEGES;
dotnet tool install --global dotnet-ef
dotnet ef migrations add ClienteAdd
dotnet ef database update
dotnet tool install -g dotnet-aspnet-codegenerator
dotnet aspnet-codegenerator controller -name ClientesController -m Cliente -dc DbContexto --relativeFolderPath Controllers --useDefaultLayout
Maria dos Anjos Serra Santos