Skip to content

josevictormobile/webapi-jobsnet

Repository files navigation

Comandos iniciais:

  mkdir entity-framework
  cd entity-framework
  dotnet new mvc

Comandos git:

  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

Componentes instalados:

  dotnet add package Microsoft.EntityFrameworkCore --version 5.0.9
  dotnet add package Microsoft.EntityFrameworkCore.Tools --version 5.0.9
  dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 5.0.9
  dotnet add package Microsoft.EntityFrameworkCore.Design --version 5.0.9
  dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design --version 5.0.2

Comandos para migração:

dotnet tool install --global dotnet-ef
dotnet ef migrations add ClienteAdd
dotnet ef database update

Instalação do code generator

dotnet tool install -g dotnet-aspnet-codegenerator

Gerando o scaffold de clientes

dotnet aspnet-codegenerator controller -name CandidatosController -m Candidato -dc DbContexto --relativeFolderPath Controllers --useDefaultLayout

dotnet aspnet-codegenerator controller -name ProfissoesController -m Profissao -dc DbContexto --relativeFolderPath Controllers --useDefaultLayout


-- Original
dotnet aspnet-codegenerator controller -name ClientesController -m Cliente -dc DbContexto --relativeFolderPath Controllers --useDefaultLayout

Gerando o scaffold de um Controlador webapi

dotnet aspnet-codegenerator controller -name CandidatosController -async -api -m Candidato -dc DbContexto -outDir Controllers

dotnet aspnet-codegenerator controller -name ProfissoesController -async -api -m Profissao -dc DbContexto -outDir Controllers

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages