This is a simple API for managing products in a retail application. It includes CRUD operations, an approval queue, and business logic for handling product updates, deletions, and creations.
- View and search active products.
- Create, update, and delete products with approval logic.
- Approval queue management.
- Unit tests for business logic.
- ASP.NET Core 8.0
- Entity Framework Core 8.0
- SQL Server (or SQLite for local testing)
- xUnit and Moq for unit testing
- .NET 8 SDK
- SQLite for local development
-
Clone this repository.
-
Install the necessary packages via
dotnet restore. dotnet add package Microsoft.EntityFrameworkCore --version 8.0.8 dotnet add package Microsoft.EntityFrameworkCore.Sqlite --version 8.0.8 dotnet add package Microsoft.EntityFrameworkCore.Tools --version 8.0.8 -
Update the connection string in
appsettings.jsonto point to your database. -
Run the database migrations using
dotnet ef migrations add InitialCreateanddotnet ef database update. -
Build the application using
dotnet build -
Run the application using
dotnet run. -
Swagger will be available at
http://localhost:5000/swagger/index.html.
Run the unit tests using the following command:
dotnet test