Skip to content

Instantly share code, notes, and snippets.

View delso-ferreira's full-sized avatar

Delso Ferreira delso-ferreira

View GitHub Profile
@delso-ferreira
delso-ferreira / cheatsheet.md
Created March 6, 2024 21:59 — forked from lucasKoyama/cheatsheet.md
REST API + CRUD + .NET 6 + EF + Authentication + Authorization + Login + External API Requests

Web API => REST API + CRUD + .NET 6 + EF + Authentication + Authorization + Login + External API Requests

The purpose of this gist is to provide a step-by-step guide on how to create a REST API with all CRUD methods using .NET 6 and Entity Framework.

💡 Additionally, you can fork this gist and use the summary checkboxes to mark the steps as finished!

💡 Every Default Method will have a boilerplate code to replace the Entity1/Entity2/Entities names accordintly to your Table or Columns names!

❗ This is a step-by-step Cheat Sheet, so I won't dive deep into explanations of technical terms, just code snippets!❗

😉 But referencial links to public explanations will be provided! 😉

@delso-ferreira
delso-ferreira / criandotestesc#.md
Last active March 8, 2024 19:08
Criando Testes em C#

Testes em C#

Os testes em C# não ficam em camadas da aplicação, no caso, para desenvolver um teste, criamos uma aplicação nova de testes. Verificando nos templates que o C# disponibiliza através de:

dotnet new --list

Poderemos ver o template de 'xUnit Test Project', ou seja, é um tipo de biblioteca que o Asp.Net tem para testar aplicações.

1 - Primeiramente, fora do diretório da API principal, executamos o comando: