https://github.com/anabeatrizwalker/apicsharp
API basic project with Entity Framework, C# language and the .NET framework. Content source: Bootcamp XP Inc. - Full Stack Developer by DIO
https://github.com/anabeatrizwalker/apicsharp
api backend csharp dotnet entity-framework
Last synced: 6 months ago
JSON representation
API basic project with Entity Framework, C# language and the .NET framework. Content source: Bootcamp XP Inc. - Full Stack Developer by DIO
- Host: GitHub
- URL: https://github.com/anabeatrizwalker/apicsharp
- Owner: anaBeatrizWalker
- Created: 2024-09-06T11:34:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T13:10:25.000Z (almost 2 years ago)
- Last Synced: 2025-03-16T01:12:25.482Z (over 1 year ago)
- Topics: api, backend, csharp, dotnet, entity-framework
- Language: C#
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Anotações de desenvolvimento
## Projeto
Criando projeto Web API com .NET na versão 6.0
```bash
dotnet new webapi --framework net6.0
```
## Pacotes
Instalando pacotes Microsoft.EntityFrameworkCore.Design e Microsoft.EntityFrameworkCore.SqlServer na versão compatível com a versão do .NET do projeto
```bash
dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0.5
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 6.0.5
```
## Migrations
As migrations servem para realizar um mapeamento que transformará as entidades do projeto em tabelas no banco de dados.
- Adicionando migration para a criação da tabela Contatos
```bash
dotnet-ef migrations add CreatingContactTable
```
- Aplicando a migration
```bash
dotnet-ef database update
```