Skip to content

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Task Manager API (ASP.NET Core)

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.

Features

  • 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)

Tech Stack

  • C#, .NET 10
  • ASP.NET Core Web API
  • Entity Framework Core (SQLite provider)
  • Swashbuckle (Swagger UI)

Getting Started

dotnet restore
dotnet ef database update
dotnet run

Server runs on the port shown in the console output. Swagger UI at http://localhost:<port>/swagger.

API Endpoints

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

Example request body (POST/PUT)

{
  "title": "Learn ASP.NET Core",
  "description": "Optional description",
  "completed": false
}

Project Structure

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

Notes on Moving from Python/FastAPI to C#/ASP.NET Core

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

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages