A small REST API for creating and listing tasks, built with ASP.NET Core (.NET 8) and documented with Swagger / OpenAPI. It was my first ASP.NET Core project: the goal was to learn how controllers, routing, model binding and validation fit together.
| Method | Route | What it does | Responses |
|---|---|---|---|
GET |
/api/tasks |
Returns every task | 200 OK with a JSON array |
POST |
/api/tasks |
Creates a task and assigns the next id | 201 Created with the task, or 400 Bad Request when the title is empty |
A task looks like this:
{ "id": 1, "title": "Write the README", "isCompleted": false }You need the .NET 8 SDK.
dotnet run --launch-profile httpThen open http://localhost:5106/swagger to try the endpoints in the browser, or send the ready-made requests in TaskManagerAPI.http from Visual Studio, Rider or VS Code.
Program.cs registers controllers and Swagger, maps routes
Controllers/TasksController GET and POST /api/tasks, validates the title
Models/TaskItem id, title, isCompleted
Tasks live in an in-memory list inside the controller, so they reset every time the app restarts. There is no database yet on purpose: this project focuses on the HTTP layer.
- Persistence with Entity Framework Core and SQLite
GET,PUTandDELETEfor a single task (/api/tasks/{id})- A service layer with dependency injection instead of a static list
- Integration tests with
WebApplicationFactory