A sample order system that uses ASP.NET Core.
-
Web API
-
Testing
- Separation of concerns
- Explicit dependencies
- Open-closed principle
-
Web API
- Install .NET SDK 7.0.
- This is because Pomelo.EntityFrameworkCore is not yet support with EF Core 8.
- Install .NET SDK 8.0 to be able to use C# 12.
- Install MariaDb Server and set the user as root.
- Create a file called
.env
with the command:
copy src/WebApi/.env.example src/WebApi/.env
- Configure the connection string in the .env file.
- Apply migrations with the command:
dotnet ef database update --project src/WebApi/WebApi.csproj
- Run
dotnet run
for a dev server. Navigate tohttps://localhost:7120/swagger/
.
- Install .NET SDK 7.0.
-
Testing
- Create a file called
test.env
with the command:
copy tests/IntegrationTests/sample.env tests/IntegrationTests/test.env
- Specify your credentials in the
test.env
. - Run the
dotnet test
command to run the tests.
- Create a file called