How batman5227/todoapihexagonal works
TodoApi is an ASP.NET Core service for managing todo items. An API client sends requests to the todos controller, which accepts request data and delegates operations through the todo-service interface to its implementation. The service reads and changes todo entities through Entity Framework Core, configured for the SQLite database todo.db. The API supports listing with a filter, create, update, mark done/undone, toggle all, and delete operations. Program.cs also registers OpenAPI and Scalar endpoints; the excerpts establish this wiring but do not show their detailed behavior.
Main entry points: Program.cs Application host · TodosController.cs Todos controller · TodoService.cs Todo operations · TodoDbContext.cs EF data context
Components 10
HTTP API
- Todos controller
Controllers/TodosController.cs - Todo request DTO
DTOs/TodoDto.cs - Application host
Program.cs - API reference endpoints
Program.cs
Todo Logic
- Todo service contract
ITodoService.cs - Todo operations
Service/TodoService.cs
Persistence
- EF data context
Data/TodoDbContext.cs - Todo entity
Models/TodoItem.cs - SQLite database
todo.db
Other components
- API client
Connections 10
- API client → Todos controller: sends requests
Controllers/TodosController.cs - Todos controller → Todo request DTO: accepts body
Controllers/TodosController.cs - Todos controller → Todo service contract: calls operations
Controllers/TodosController.cs - Application host → Todos controller: maps controllers
Program.cs - Application host → Todo service contract: registers implementation
Program.cs - Application host → Todo operations: registers implementation
Program.cs - Todo operations → EF data context: queries and saves
Service/TodoService.cs - EF data context → Todo entity: maps entity
Data/TodoDbContext.cs - Application host → SQLite database: configures SQLite
Program.cs - Application host → API reference endpoints: maps OpenAPI UI
Program.cs