Discover how to build secure, RESTful APIs with C# and ASP.NET Core. You’ll explore routing, data validation, EF Core, and JWT authentication — then bring it all together in a CRUD-based mini project. Perfect for learners ready to build back-end services for web or mobile apps.
🗓️ Course Schedule: C# Web API with ASP.NET Core
Duration: 3 Days
Time: 10:00 AM – 4:00 PM Daily
Format: Practical Labs • Live Coding • Real-World Project Work
🔹 Day 1: REST Fundamentals & Building Your First API
10:00 AM – 12:30 PM
🌐 Understanding HTTP, REST & API Design Principles
- What is an API? REST vs RPC
- HTTP methods and status codes:
GET
,POST
,PUT
,DELETE
, etc. - RESTful design best practices
- JSON as the standard data exchange format
- Designing resources and endpoints
12:30 PM – 1:30 PM — Lunch Break
1:30 PM – 4:00 PM
🛠️ Creating Your First Web API in Visual Studio
- Setting up a new ASP.NET Core Web API project
- Understanding project structure and built-in features
- Creating your first controller and routes
- Implementing
GET
,POST
,PUT
, andDELETE
endpoints - Live Lab: Build a basic Book or Product API using in-memory data
🔹 Day 2: Routing, Middleware, and EF Core Integration
10:00 AM – 12:30 PM
🧭 Routing, Attribute Routing & Model Validation
- Conventional vs attribute-based routing
- Route constraints and patterns
- Binding models from query, route, and body
- Validating input with
[Required]
,[Range]
,[StringLength]
, etc. - Custom error messages and HTTP 400 responses
12:30 PM – 1:30 PM — Lunch Break
1:30 PM – 4:00 PM
⚙️ Middleware, Error Handling & EF Core Integration
- Using built-in middleware (logging, exception handling)
- Global exception filters
- Adding Entity Framework Core to your Web API
- Setting up
DbContext
, models, and migrations - Connecting your API to a database (e.g., SQLite or SQL Server)
- Lab: Add EF Core to your existing Book/Product API project
🔹 Day 3: Security, Documentation & Final Project
10:00 AM – 12:30 PM
🔐 Securing APIs with JWT and Role-based Access
- Introduction to JWT (JSON Web Tokens)
- Adding authentication and role-based authorization
- Protecting routes using
[Authorize]
,[AllowAnonymous]
, and roles - Token validation and user claims
- Lab: Secure selected endpoints with JWT login flow
12:30 PM – 1:30 PM — Lunch Break
1:30 PM – 4:00 PM
📘 API Documentation & Capstone Project
- Integrating Swagger/OpenAPI for API testing and documentation
- Customizing Swagger UI and annotations (
[Produces]
,[Consumes]
) - Final Project: CRUD API for Task Manager or Contact Book
→ Full implementation with routes, EF Core, validation, JWT, and Swagger - Testing with Swagger and Postman
- Course recap and Q&A
🧠 What You’ll Learn
- How to build RESTful APIs using ASP.NET Core Web API
- Structuring routes, models, and validation logic effectively
- Integrating with a real database using Entity Framework Core
- Securing APIs with JWT and implementing user roles
- Documenting and testing APIs with Swagger
- Practical experience building a production-grade backend project