A sample RESTful Web Service of Clean Architecture and rich domain model.
Where it all started. It is the center of architecture. Includes only domain logic. It has no dependencies to any project or package.
It depends on Domain. Includes application logic, contracts, mappings, validations.
It depends on application core (Application and Domain). It doesn't include any logic, only includes data access implementations related to application core.
It includes some of technologies related to application core.
It is the startup project. Handles requests from client. It includes Web and Http related implementations, RESTful concepts, endpoints, dependency injections.
- .Net 5.0
- AspNetCore WebAPI
- EntityFrameworkCore
- FluentValidation
- MediatR
- AutoMapper
- MSSQLServer
- Docker
Clone from GitHub
git clone https://github.com/tolgacakir/ride-share.git
- Add Migration
dotnet ef migrations add InitialMigration --project src/RideShare.Persistence
- Restore
dotnet restore src/RideShare.Api
Make sure the SQL Server name in the connection string is correct.
- Run
dotnet watch run --project src/RideShare.Api
Make sure the SQL Server name in the connection string is correct.
Make sure the generated rideshare-api image is generated from your code has the correct connection string.
- Add Migration
dotnet ef migrations add InitialMigration --project src/RideShare.Persistence
- Create Docker compose:
docker-compose up
- Browse Swagger:
http://localhost:5000/swagger/index.html