Skip to content

Clean Architecture Endpoints Solution Template: A starting point for Clean Architecture Endpoints with ASP.NET Core.

License

Notifications You must be signed in to change notification settings

ShadyNagy/ShadyNagy.ApiTemplate

Repository files navigation

.NET Core publish to nuget ShadyNagy.ApiTemplate on NuGet NuGet License

ShadyNagy.ApiTemplate

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.

Give a Star! ⭐

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.

EF Migrations Commands

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

Some CLI

dotnet format whitespace
dotnet format style

About

Clean Architecture Endpoints Solution Template: A starting point for Clean Architecture Endpoints with ASP.NET Core.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages