/orders-sample

A sample order system that uses ASP.NET Core

Primary LanguageC#MIT LicenseMIT

sample order system

A sample order system that uses ASP.NET Core.

Technologies used

Patterns used

Common design principles

  • Separation of concerns
  • Explicit dependencies
  • Open-closed principle

Installation

  • 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 to https://localhost:7120/swagger/.
  • 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.