A set of clean approaches based on cqrs (mediatR) to api development using the fictional example of customer orders
The API describes a fictional example of creating product orders for a specific customer. The API, built using RESTful principles, allows you to perform CRUD operations on 3 data types: Customer, Product, and Order.
This project is based on ASP .NET Core
using the MediatR
library. The application uses Sqlite
as a persistent data store. The main reasons for this are ease of implementation and no need for a SQL server, which is acceptable for a home project.
This application has already been deployed to the web using the Heroku
service.
To use it as API add to the route api/v1/[ControllerName]
Clone the project
git clone https://github.com/VitaliyMinaev/OrdersApi.git
Go to the project directory
cd OrdersApi
Start the server
dotnet run
To run this project, you will need to add the following environment variables
DatabaseCreated
- Responsible for the state of the data source, takes the value "true" if the database has already been created and the current state of the objects describes their representation in the database (no migrations are required) and "false" if the database requires a migration operation (recommended value for the first run)
ASP .NET Core Web API
- as backend frameworkMediatR
Entity Framework Core
- as ORMSqlite
- as data storageIn Memory caching
- withScrutor
XUnit
- as framework for testing