QuickDevGuide

Home › .NET Core Web API

Services & Controllers — .NET Core Web API

The Service layer contains business logic, maps between Entities and DTOs, and depends only on repository interfaces. Controllers handle HTTP requests, apply authorization, and delegate to services. Service Implementation Controller Implementation Authorization Rules Annotation Scope Effect [Authorize] on class All endpoints Require valid JWT by default [AllowAnonymous] GET endpoints Read operations are public No annotation POST/PUT/DELETE Require authentication API Endpoints Method URL Auth Description GET /api/categories Public Get all categories GET /api/categories/{id} Public Get by ID POST /api/categories JWT Create category PUT /api/categories/{id} JWT Update category DELETE /api/categories/{id} JWT Delete category GET /api/subcategories Public Get all subcategories GET…

Key Takeaways