Building ASP.NET Core REST APIs with an AI-Powered Workflow

Build production-ready APIs with C#, Entity Framework Core & PostgreSQL. Learn AI-assisted development workflow.

  • 0.0 (0 Reviews)
  • 0 Students
  • 338 Lessons
  • Elegant Code – Krystyna Ślusarczyk

Course Overview

Welcome to “Building ASP.NET Core REST APIs with an AI-Powered Workflow”, a complete, hands-on course where you build a real REST API from scratch, the way it is done in professional projects.


As a .NET Technical Lead with over a decade of experience, I’ll guide you every step of the way, from your very first endpoint to a secured, fully tested API.


Why learn to build APIs with ASP.NET Core?

APIs are behind almost every modern application. Web apps, mobile apps, and other systems all rely on them to communicate. That’s why almost every company builds APIs, and why API development is one of the most in-demand skills employers look for in .NET developers. ASP.NET Core is one of the fastest and most widely used frameworks for building them, trusted by companies of all sizes.


Building an API that simply works is not that hard. Building one that is secure, maintainable, and follows industry best practices is a different skill. That skill is what professional teams expect, and it is exactly what this course will teach you.


What makes this course different?

  • Best practices from day one. We write professional-grade code from the start, so you never have to unlearn shortcuts later.

  • We go beyond “it works”. You’ll understand why each decision is made, not just how to type the code.

  • Both Minimal APIs and Controllers. You’ll learn both approaches and know when to choose which.

  • Real-world architecture. DTOs, mapping, validation, a service layer, and the result pattern, the way they are used in production codebases.

  • Security done right. User management with ASP.NET Core Identity, JWT authentication, role-based authorization, and safe handling of secrets.

  • Automated testing. You’ll write integration and unit tests and learn how to make them fast, reliable, and easy to maintain.

  • Constant refactoring. We review and improve our code as the project grows, just like in a real team.


AI as a tool, not a replacement for understanding

AI tools are now part of everyday work for many developers. In this course, you’ll learn to use GitHub Copilot and Claude Code responsibly. We only use AI for things we already understand, and we review every line it produces. You’ll learn how to write good prompts, how to verify AI output, and when not to use AI at all.

The AI part is fully optional. You can complete the entire course without any AI tools, or using free tools only.


Technologies covered:

.NET 10, C#, ASP.NET Core, Entity Framework Core, PostgreSQL,  FluentValidation, Mapperly, ErrorOr, ASP.NET Core Identity, JWT, Scalar, and Postman. The course works on both Windows and macOS, with Visual Studio Community and VS Code.


Additional perks:

  • Full Git repository with all code shown in the course.

  • This course is covered by Udemy’s 30-day Refund Policy, so you can try it out risk-free.


Professional API development is one of the most valuable skills a .NET developer can have. Learn it the right way, with the tools modern developers actually use.


Enroll now and start building APIs like a pro!

See more

FAQ

FAQ area empty

Course curriculum

29 chương 338 bài học 23 giờ 20 phút 7 bài học thử miễn phí
Chương 1 Introduction
Chương 2 The basics of APIs
  • Section introduction 0:39
  • What are APIs and why do we need them? 5:53
  • What is ASP.NET Core? 4:03
  • How web communication works. HTTP 3:03
  • Web communication in action 4:29
  • JSON 4:02
  • Resource vs Endpoint 2:16
  • The basics of APIs
Chương 3 Environment setup
  • Section introduction 1:27
  • (Windows) Installing Visual Studio Community 2:17
  • (Windows) Installing Visual Studio Code 3:09
  • (MacOS) Installing Visual Studio Code 6:16
Chương 4 Project setup and overview
  • Section introduction 0:26
  • [Visual Studio Community] Creating a new ASP.NET Core Web API project 5:08
  • [Visual Studio Code] Creating a new ASP.NET Core Web API project 5:53
  • Project structure overview 4:17
  • Understanding the Program.cs file 4:07
  • Running the API and sending your first request 6:34
  • [Visual Studio Community] Debugging with breakpoints 0:48
  • [Visual Studio Code] Debugging with breakpoints 1:21
  • Using the Console 2:47
  • Project setup and overview
  • Source code for this section
Chương 5 [Optional] Setting up Git repository
  • Section introduction 2:16
  • Introduction to source control 4:25
  • GitHub fundamentals & account setup 2:17
  • Initializing a Git repository (Visual Studio Community) 4:14
  • Initializing a Git repository (Visual Studio Code) 6:19
  • Using Git from the IDE 5:59
Chương 6 Defining the first endpoint
  • Section introduction 0:33
  • The API we will build 2:28
  • Minimal API vs Controllers 5:40
  • Defining the first entity 5:53
  • Defining the first endpoint. GET 7:32
  • Registering the endpoint 9:23
  • Defining the first endpoint
  • Source code for this section
Chương 7 Testing the API manually
  • Section introduction 0:33
  • Calling the API from the IDE. HTTP files 6:28
  • The importance of endpoint registration 1:30
  • OpenAPI documentation 3:03
  • Setting up Scalar 4:39
  • Using Scalar 2:34
  • Understanding the launchSettings.json file 5:04
  • Configuring launch settings 3:11
  • Testing the API manually
  • Source code for this section
Chương 8 REST APIs
  • Section introduction 0:27
  • REST 8:52
  • HTTP Response Codes 7:47
  • HTTP Methods - GET, POST, PUT, PATCH, DELETE 6:14
  • Method safety and idempotency 4:28
  • HTTP Methods - HEAD, OPTIONS, TRACE and CONNECT 2:15
  • HTTP methods best practices 2:20
  • REST API best practices 7:35
  • REST APIs
Chương 9 CRUD with Minimal APIs
  • Section introduction 0:20
  • GET by ID. Route parameter binding 3:58
  • Route constraints 4:41
  • Documenting response types with Produces 3:43
  • Type-safe responses in Minimal APIs 6:44
  • Model binding 2:35
  • POST 4:34
  • The response from POST 6:12
  • Problem Details 3:59
  • Updating endpoints to produce Problem Details 6:36
  • PUT or PATCH? 3:35
  • PUT 9:24
  • DELETE 4:22
  • CRUD with Minimal APIs
  • Source code for this section
Chương 10 AI Tools — a practical introduction
  • Section introduction 3:10
  • Chat GPT & Claude in the browser 5:48
  • Copilot or Claude Code? What to know before you choose 1:59
  • Setting up GitHub Copilot in Visual Studio Community 1:42
  • Setting up GitHub Copilot in Visual Studio Code 2:05
  • Setting up Claude Code in Visual Studio Code 2:30
  • GitHub Copilot - a basic tutorial 11:36
  • Claude Code - a basic tutorial 10:33
  • Prompting basics for coding tasks 6:10
  • When to be careful with AI 7:14
  • AI Tools — a practical introduction
Chương 11 CRUD with Controllers
  • Section introduction 0:45
  • Author entity 1:29
  • GET 6:57
  • Understanding ActionResult<T> 5:16
  • GET by Id 6:14
  • POST 7:18
  • PUT 3:53
  • DELETE 3:14
  • Minimal APIs vs Controllers - summary 3:57
  • CRUD with Controllers
  • Source code for this section
Chương 12 Database and Entity Framework Core
  • Section introduction 0:41
  • Databases 5:02
  • PostgreSQL 2:59
  • Installing Docker 3:41
  • Installing PostgreSQL - command
  • Installing PostgreSQL 2:34
  • Installing DBeaver 1:36
  • Connecting DBeaver to our database 2:20
  • Introduction to Entity Framework Core 5:35
  • Code first vs Database first 2:22
  • Entity Framework Core setup - commands
  • Entity Framework Core setup 3:07
  • DbContext 6:17
  • Appsettings 4:04
  • Connection strings 3:33
  • Migrations 5:05
  • Migration files 4:07
  • Applying a migration 1:44
  • Browsing the database in DBeaver 6:31
  • Troubleshooting migrations and database Issues 4:29
  • Updating CategoriesEndpoints to use the database 11:40
  • Updating AuthorsController to use the database 4:59
  • Why do we use concrete DbContext? 3:43
  • Dependency Injection in ASP.NET Core 4:10
  • Service lifetime 4:44
  • Adding seed data 7:03
  • Switching to Microsoft SQL Server 6:53
  • Database and Entity Framework Core
  • Source code for this section
Chương 13 DTOs
  • Section introduction 0:23
  • The need for DTOs 1:46
  • DTOs 7:32
  • Introducing DTOs for Categories 4:20
  • Updating the Categories Endpoints to use DTOs 6:48
  • One DTO per operation 4:51
  • Updating the AuthorsController to use DTOs 7:20
  • DTOs
  • Source code for this section
Chương 14 Mapping
  • Section introduction 0:25
  • The problem with manual mapping 2:39
  • Introducing Mapperly 5:54
  • Using the mapper in AuthorsController 5:41
  • Mapperly — handling more complex cases 6:33
  • Using the mapper for Categories 6:43
  • Mapping
  • Source code for this section
Chương 15 Validation
  • Section introduction 0:45
  • The need for validation 2:44
  • Validation with Data Annotations 10:17
  • Introduction to FluentValidation 3:29
  • Validation with FluentValidation 6:55
  • Validation with FluentValidation - refactoring 4:13
  • Validation Rules — Data Annotations vs FluentValidation 7:17
  • Validation and database checks 2:58
  • FluentValidation in Controllers 6:00
  • Data Annotations in Minimal APIs 2:24
  • Validation
  • Source code for this section
Chương 16 ASP.NET Core request pipeline
  • Section introduction 0:25
  • Request pipeline and middleware 7:54
  • Configuring the request pipeline in Program.cs 3:05
  • HttpContext 3:46
  • Custom middleware 8:43
  • Extracting middleware into a class 5:10
  • Global exception handling 3:33
  • Custom global exception handler 6:25
  • ASP.NET Core request pipeline
  • Source code for this section
Chương 17 Endpoint filters and action filters
  • Section introduction 0:26
  • Introduction to endpoint filters and action filters 6:35
  • The need for endpoint filters 6:00
  • Custom endpoint filter 6:10
  • Extracting the endpoint filter into a reusable class 5:02
  • Custom action filter 8:33
  • Endpoint filters and action filters
  • Source code for this section
Chương 18 Entity Relationships in EF Core
  • Section introduction 1:03
  • Relationships in relational databases 3:48
  • One-to-Many relationships in EF Core 6:28
  • Many-to-Many relationships in EF Core 3:43
  • Adding BooksController 7:33
  • Adding BookMapper 2:23
  • Including related data in DTOs 6:03
  • DTO flattening 6:44
  • Loading related data with Include 6:19
  • Adding collections to DTOs 4:16
  • Circular references in DTOs 6:58
  • Updating related data in EF Core 5:17
  • Updating available copies when total copies change 5:18
  • Different DTOs for different endpoints 5:46
  • Deciding which side owns the relationship 5:19
  • Preventing deletion of entities with related data 5:16
  • Configuring Mapperly for related data 4:52
  • AI code review in practice 8:35
  • Entity Relationships in EF Core
  • Source code for this section
Chương 19 Pagination, Filtering & Sorting
  • Section introduction 0:34
  • The need for pagination 3:47
  • Query parameters and URL segments 3:33
  • Implementing pagination 5:47
  • Pagination metadata in response headers 4:08
  • Reusable pagination parameters 5:37
  • Breaking changes and API contracts 8:02
  • Binding sources 4:19
  • Implementing filtering 8:50
  • Nested resources and query parameters in MinimalAPIs 10:51
  • Implementing sorting 10:40
  • Pagination, Filtering & Sorting
  • Source code for this section
Chương 20 Service Layer
  • Section introduction 1:13
  • The need for service layer 7:03
  • Introducing the first service 7:01
  • Introducing the result pattern 2:40
  • The ErrorOr library 9:10
  • Using ErrorOr in the service 5:08
  • Handling ErrorOr results in the controller 6:46
  • Moving GetAll business logic to the service 7:52
  • Moving GetById and Update business logic to the service 5:05
  • Moving the Delete business logic to the service 3:15
  • Refactoring AuthorsController to use service layer 4:39
  • Service Layer
  • Source code for this section
Chương 21 HTTP Patch
  • Section introduction 0:17
  • Partial updates and the PATCH method 5:12
  • Implementing PATCH - DTO and mapper 5:46
  • Implementing PATCH - service layer 4:56
  • Implementing PATCH - controller 3:51
  • Validating PATCH values 4:01
  • Validating PATCH model 3:41
  • HTTP Patch
  • Source code for this section
Chương 22 Advanced business logic
  • Section introduction 0:42
  • Introducing the Member entity 7:54
  • Implementing the Member endpoints 6:24
  • Soft delete of a member 6:20
  • Restoring soft-deleted records 3:22
  • Introducing the Loan entity 6:59
  • Introducing the LoansController and the Loan DTO 6:28
  • Implementing GetAll and GetById for Loans 10:26
  • Implementing the Create endpoint for Loans 10:20
  • Returning a book 6:47
  • Testing the Loans endpoints 4:12
  • Adding loan-related changes to the Members endpoints 7:52
  • Adding loan-related changes to the Book endpoints 8:11
  • Advanced business logic
  • Source code for this section
Chương 23 Automated testing
  • Section introduction 1:42
  • Why we need automated tests 5:40
  • Setting up the test project 3:47
  • Writing the first integration test (Testing POST for Categories) 9:49
  • Why tests should not use the real database 3:11
  • Switching to an in-memory database 4:17
  • Integration tests vs unit tests 4:23
  • The need to reset the database before each test 5:39
  • Testing GET by ID for Categories 4:05
  • Integration tests refactoring 5:04
  • Testing GET for Categories 4:38
  • Testing PUT for Categories 3:03
  • Refactoring & HttpResponseMessageExtensions 6:58
  • Testing DELETE for Categories 2:00
  • Measuring code coverage 3:15
  • Testing error scenarios - GET 4:35
  • Testing error scenarios - POST, PUT, DELETE 4:59
  • Testing across multiple resources 5:10
  • Introducing TestDataFactory 10:46
  • Testing validation with integration tests 3:58
  • Testing validation with unit tests 6:58
  • Testing getting books by category 12:43
  • Reviewing integration tests 18:24
  • Extracting a base class for integration tests 10:06
  • What's next with testing 1:52
  • Automated testing
  • Source code for this section
Chương 24 Project organization and refactoring
  • Section introduction 1:02
  • Appending pagination headers in an extension method 6:43
  • Extracting patch document validation into a method 3:08
  • Moving errors into classes for Minimal API endpoints 2:17
  • Extracting pagination logic into a common method 8:47
  • Making sorting deterministic 11:52
  • Refactoring of filtering and sorting 9:58
  • Project organization and refactoring
  • Source code for this section
Chương 25 User management with ASP.NET Core Identity
  • Section introduction 1:06
  • The need for authentication and authorization 2:55
  • Authentication methods overview 5:02
  • Introduction to ASP.NET Core Identity 2:28
  • Setting up ASP.NET Core Identity 3:40
  • Configuring the model with OnModelCreating 3:45
  • Completing the Identity setup 5:17
  • ApplicationUser vs Member 4:57
  • Linking members to user accounts 7:06
  • Introduction to roles 2:56
  • Seeding roles 9:06
  • Creating the user registration DTO 3:04
  • Implementing the authentication service 7:15
  • Adding endpoint for user registration 8:08
  • Ensuring atomicity with transactions 4:14
  • Removing member creation endpoint 4:13
  • Fixing the tests 13:58
  • User Management with ASP.NET Core Identity
  • Source code for this section
Chương 26 JWT authentication and authorization
  • Section introduction 1:25
  • Basics of JWT 2:53
  • Inside a JWT token 7:37
  • JWT configuration 6:55
  • Storing secrets safely 3:55
  • Setting up JWT authentication 6:31
  • Protecting an endpoint 2:59
  • The login endpoint 2:48
  • Verifying credentials 3:32
  • Generating the JWT token 5:59
  • Testing the login endpoint 3:52
  • Returning meaningful errors for unauthenticated requests 3:38
  • Seeding the first librarian 4:13
  • Implementing the register librarian logic 5:30
  • Role-based authorization 5:42
  • Accessing the current user 4:28
  • Protecting access to own resources 3:07
  • Getting started with Postman 6:25
  • Environments and automatic authorization in Postman 8:58
  • Practical tips for working with Postman 5:25
  • Securing all endpoints 8:35
  • Updating the integration tests — the plan 1:38
  • Providing JWT key for testing purposes 2:36
  • Updating existing integration tests to work with authentication 7:17
  • Speeding up password hashing in tests 3:03
  • Testing unauthorized access 2:16
  • Testing forbidden access 3:53
  • Parameterized authorization tests 5:00
  • The AuthorizationTests suite 4:03
  • Testing access to own resources 3:40
  • JWT authentication and authorization
  • Source code for this section
Chương 27 [Coming Soon] API versioning
  • API versioning
Chương 28 [Coming soon] API deployment
  • API deployment
Chương 29 Bonus section
  • Bonus lecture (discount coupons!)

Requirment

  • Basic knowledge of C#. I’ll teach you everything you need to know about building APIs.

  • No prior experience with ASP.NET Core, databases, or AI tools is needed.

  • A computer (Windows/macOS) with access to the Internet.

  • No paid software is needed. All tools used in this course are free, and paid AI tools are optional.

Outcomes

  • Build professional REST APIs with ASP.NET Core from scratch.

  • Design APIs that follow REST principles and industry best practices.

  • Write clean, maintainable, professional-grade API code.

  • Build APIs with both Minimal APIs and Controllers, and know when to use which.

  • Work with databases using Entity Framework Core and PostgreSQL.

  • Secure APIs with ASP.NET Core Identity, JWT, and role-based authorization.

  • Write integration and unit tests for your APIs.

  • Use GitHub Copilot and Claude Code responsibly to speed up your work.

Instructor

...
Elegant Code – Krystyna Ślusarczyk

0.0

  • ... 0 Student
  • ... 3 Courses
  • ... 0 review

View Details

Reviews

Rate this course :

Remove all