This is an API solution & also template for support minimal e-commerce application using .NET5 following the principles of Clean Architecture inspire from Jason Taylor. Use this template button or by installing and running the associated NuGet package (see Getting Started for full details). It's easy to jump start from beginning you can try it the barebone project v0.0.1-beta
Recommend to learn Clean Architecture with ASP.NET Core 3.0 • Jason Taylor • GOTO 2019
- NET5
- Entity Framework Core 5
- MediatR
- AutoMapper
- FluentValidation
- XUnit, FluentAssertions, Moq & Respawn
- SQLite
- Install the latest .NET 5 SDK
- Install Redis using docker & run
docker run -d --rm -p 6379:6379 redis
- Go to
ZCommerce.API
& Rundotnet run
to run this project template
To use dotnet-ef
for your migrations please add the following flags to your command (values assume you are executing from repository root)
--project ./src/Infrastructure
(optional if in this folder)--startup-project ./src/Api
--output-dir Data/Migrations
For example, to add a new migration from the root folder:
dotnet ef migrations add "SampleMigration" --project ./src/Infrastructure --startup-project ./src/Api --output-dir Data/Migrations
Update Database,
dotnet ef database update --project ./src/Infrastructure --startup-project ./src/Api
This will contain all entities, enums, exceptions, interfaces, types and logic specific to the domain layer.
This layer contains all application logic. It is dependent on the domain layer, but has no dependencies on any other layer or project. This layer defines interfaces that are implemented by outside layers. For example, if the application need to access a notification service, a new interface would be added to application and an implementation would be created within infrastructure.
This layer contains classes for accessing external resources such as file systems, web services, smtp, and so on. These classes should be based on interfaces defined within the application layer.
This layer contain all API end points and contract with ZCommerce.Application via MediatR.
If you are having problems, please let us know by raising a new issue.
This project is licensed with the MIT license.
Connect with me