A RESTful API for managing tasks, built with C#, ASP.NET Core, and Entity Framework Core. Project 12 in a sequential backend engineering learning journey — the first C# project, following the Node.js and Python phases of this series.
- Full CRUD for tasks (Create, Read, Update, Delete)
- Persistent storage via SQLite, managed through EF Core
- File-based, version-controlled database migrations
- Automatic interactive API docs via Swagger/OpenAPI
- Built-in dependency injection (constructor-injected DbContext)
- C#, .NET 10
- ASP.NET Core Web API
- Entity Framework Core (SQLite provider)
- Swashbuckle (Swagger UI)
dotnet restore
dotnet ef database update
dotnet runServer runs on the port shown in the console output. Swagger UI at
http://localhost:<port>/swagger.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tasks | Get all tasks |
| GET | /api/tasks/{id} | Get a single task |
| POST | /api/tasks | Create a new task |
| PUT | /api/tasks/{id} | Update a task |
| DELETE | /api/tasks/{id} | Delete a task |
{
"title": "Learn ASP.NET Core",
"description": "Optional description",
"completed": false
}Controllers/ - API controllers (routing + request handling combined) Models/ - EF Core entity classes Data/ - DbContext (schema + database access) Migrations/ - Generated EF Core migration files Program.cs - App startup, DI registration, middleware pipeline
This project mirrors the CRUD pattern from the FastAPI phase, with framework-native equivalents:
- Pydantic schemas → C# model classes with compile-time type checking
- SQLAlchemy
create_all()at startup → explicit, file-based EF Core migrations (dotnet ef migrations add,dotnet ef database update) - FastAPI's
Depends()→ ASP.NET Core's built-in DI container (constructor injection) - FastAPI's automatic
/docs→ Swagger UI via Swashbuckle