- Jetbrains Rider 2022.2.2
- .NET Core 6
- .NET CLI
- You can use Inmemory DB for test!!
- Install ef tool
dotnet tool install --global dotnet-ef
- Start a MSSQL
- For common users
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=P@$$w0rd' -p 1433:1433 -d mcr.microsoft.com/mssql/server
- For Apple Silicon users
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=P@$$w0rd' -p 1433:1433 -d mcr.microsoft.com/azure-sql-edge
- For common users
- Set environment string (DB)
- Migrate DB
This project will migrate db automatically.
$ dotnet ef migrations add <CommitMessage> \
--project ./src/Migrators/Migrators.<DBProvider>/ \
--context ApplicationDbContext \
-o Migrations/Application \
--startup-project ./src/Host
# revert
$ dotnet ef database update <previous-migration-name> \
--startup-project ./src/Host \
--context ApplicationDbContext
# remove
$ dotnet ef migrations remove \
--project ./src/Migrators/Migrators.<DBProvider>/ \
--startup-project ./src/Host \
--context ApplicationDbContext
All the environment variables are located at src/Host
, there are all the configuration files, one for each area.
This project is based on codewithmukesh, which can be download from here. Detailed architecture introduction can be found here and CQRS Design.