A .NET 9 task manager with two interfaces — a CLI console app and a RESTful Web API — sharing the same business logic and data layer. Demonstrates Clean Architecture, SOLID principles, Repository Pattern, Dependency Injection, and EF Core / SQLite.
TaskManager.CLI/ — Console app (keyboard-driven menu)
TaskManager.Api/ — Web API (HTTP endpoints)
TaskManager.Tests/ — xUnit unit tests
Both the CLI and API use the same TaskService and IRepository<T> — the interface layer doesn't care whether a person or another program is calling it.
- Language: C# 13 (.NET 9)
- Data Layer: Entity Framework Core, SQLite, JSON Serialization
- Testing: xUnit, Moq
- Patterns: Repository Pattern, Dependency Injection, Clean Architecture
Three repository implementations — swap them via DI:
| Repository | Storage | When to use |
|---|---|---|
SqlRepository<T> |
SQLite (EF Core) | Default |
JsonRepository<T> |
JSON file | Simple file-based storage |
InMemoryRepository<T> |
In-memory list | Testing |
| Method | Route | Description |
|---|---|---|
| GET | /api/tasks | List all tasks |
| POST | /api/tasks | Create a task |
| PUT | /api/tasks/{id} | Mark task as completed |
| DELETE | /api/tasks/{id} | Delete a task |
Requires .NET 9 SDK.
dotnet run --project TaskManager.CLIdotnet run --project TaskManager.ApiThen open http://localhost:5000/api/tasks.
dotnet test- Module 1: OOP, Repository Pattern & Defensive Programming
- Module 2: Unit Testing with xUnit & Moq
- Module 3: Dependency Injection & Service Layer
- Module 4: SQL Persistence with EF Core
- Module 5: ASP.NET Core Web API (Full CRUD)