REST APIs with C# .NET

Prerequisites

Initial Setup

  1. Install Chocolatey to manage all software in Windows
  2. Install Visual Studio Code
  3. Install MySQL
  4. Install MySQL Workbench
  5. Install Docker Desktop
  6. Install Git

Dependency Injection

  1. AddSingleton(), AddScoped() & AddTransient() in a .NET 7 Web API

Repository Pattern

  1. The Repository Pattern explained for EVERYONE (with Code Examples)

Authentication and Authorization with JWT

  1. Create JSON Web Tokens (JWT) - User Registration / Login / Authentication

  2. Stay Fresh: .NET 7 Web API Refresh Tokens

  3. Role-Based Authorization with JSON Web Tokens (JWT) & the dotnet user-jwts CLI

  4. How to Read Claims of a JSON Web Token in a .NET 7 Web API

REST API

  1. .NET 7 Web API & Entity Framework → Full Course (CRUD, Repository Pattern, DI, SQL Server & more)

  2. Improve the developer experience of an API with Swagger documentation

Microservices

  1. Create microservices with .NET and ASP.NET Core

Exercises I

  1. Create ToDoList API project.
  2. Use Visual Studio Code as your IDE and MySQL as the database.
  3. For database diagram, you could follow this video as your references.
  4. Use EF Core and Code-First Migrations.
  5. Implement Dependency Injection and Repository Pattern.
  6. Use Mapster to map the models (if needed). Follow the tutorial here
  7. Log any error using Serilog. Follow the tutorial here
  8. Implement Authentication (JWT with refresh token). Only authorized user can access TodoItem’s API.
  9. Create unit tests using xUnit. Follow the tutorial here
  10. Containerize the Web API project and MySQL using Docker. Check this tutorial for your references.
  11. Push your project to your private repository in TSP’s Gitlab.

Clean Architecture & DDD

  1. ASP.NET 6 REST API Following CLEAN ARCHITECTURE & DDD Tutorial