-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.txt
More file actions
47 lines (31 loc) · 1.55 KB
/
commands.txt
File metadata and controls
47 lines (31 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
git config --global user.name miguelpiras
git config --global user.email miguelpiras08@gmail.com
dotnet new sln --name Projeto3DS
dotnet new mvc -o Projeto3DS
dotnet sln add Projeto3DS\Projeto3DS.csproj
cd Projeto3DS
dotnet watch run
dotnet add package Microsoft.EntityFrameworkCore --version 9.0.1
dotnet add package Microsoft.EntityFrameworkCore.Design --version 9.0.1
dotnet add package Microsoft.EntityFrameworkCore.Tools --version 9.0.1
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore --version 9.0.1
dotnet add package MySql.EntityFrameworkCore --version 9.0.0
Criar a camada de dados (criar as classes na models)
Categoria
Produto
ProdutoFoto
Usuario
Criar um contexto na pasta Data
Configurar a ConnectionString no appsettings.json
configurar os serviços de Contexto e Identity no Program.csproj
Executar o Xampp e MySql
Abrir o Terminal:
cd GStore
dotnet watch run
Gerador de Código AspNetCore:
dotnet tool install --global dotnet-aspnet-codegenerator --version 9.0.0
fotnet aspnet-codegenerator -h
dotnet aspnet-codegenerator controller -name CategoriasController --model Categoria --dataContext AppDbContext --layout "~/Views/Shared/_LayoutAdmin.cshtml" -outDir Controllers
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design --version 9.0.0
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 9.0.1
dotnet aspnet-codegenerator controller -name ProdutosController --model Produto --dataContext AppDbContext --layout "~/Views/Shared/_LayoutAdmin.cshtml" -outDir Controllers