This is set of templates for creating ASP.NET Core apis following a Clean Architecture structure. Create a new project based on a chosen template between (basic, medium, advanced) by installing the associated command.
- ASP.NET Core 5
- Swagger
- Moq
- XUnit
- Install the latest .NET 5 SDK
- Run
dotnet new --install clean-architecture-templates/
- Run
dotnet new 'clean architecture' --list
.
This will display all clean architecture templates available for you:
These templates matched your input: 'clean architecture'.
Templates Short Name Language Tags
------------------------- ---------- -------- -------
Medium Clean Architecture mca [C#] Web/Api
Basic Clean Architecture bca [C#] Web/Api
- Create a directory with the name of your project and cd into it or just add
-o MyOutputFolderName
in the next's commands below
- Run
dotnet new bca -s MySolutionName -p MyProjectName
- Navigate to
src/MyProjectName
and rundotnet run
to launch the project
The directory structure:
- Run
dotnet new mca -s MySolutionName -p MyProjectName
- Navigate to
src/MyProjectName.presentation
and rundotnet run
to launch the project
The directory structure: