A starting point for Clean Architecture Endpoints with ASP.NET Core. Clean Architecture is just the latest in a series of names for the same loosely-coupled, dependency-inverted architecture. You will also find it named hexagonal, ports-and-adapters, or onion architecture.
If you like or are using this project to learn or start your solution, please give it a star. Thanks!
Or if you're feeling really generous, we now support GitHub sponsorships - see the button above.
Ensure the tool EF was already installed. You can find some help here
setx PATH "%PATH%;C:\Users\USER_NAME\.dotnet\tools"
dotnet tool install --global dotnet-ef
Add a new migration (from the ShadyNagy.ApiTemplate.Api folder):
dotnet ef migrations add MIGRATIONNAME -c appdbcontext -p ../ShadyNagy.ApiTemplate.Infrastructure/ShadyNagy.ApiTemplate.Infrastructure.csproj -s ShadyNagy.ApiTemplate.Api.csproj -o Data/Migrations
Update AppDbContext model (from the ShadyNagy.ApiTemplate.Api folder):
dotnet ef database update -c appdbcontext -p ../ShadyNagy.ApiTemplate.Infrastructure/ShadyNagy.ApiTemplate.Infrastructure.csproj -s ShadyNagy.ApiTemplate.Api.csproj
Generate Idempotent Update Script (for production)(from the ShadyNagy.ApiTemplate.Api folder):
dotnet ef migrations script -c AppDbContext -i -o migrate.sql -p ../ShadyNagy.ApiTemplate.Infrastructure/ShadyNagy.ApiTemplate.Infrastructure.csproj -s ShadyNagy.ApiTemplate.Api.csproj
dotnet format whitespace
dotnet format style