.NET Core Microservices - The Complete Guide (.NET 6 MVC)

Video description

In this course, you will learn the foundational elements of microservices by incrementally building a real microservices-based application with .NET 6, step by step. We will be building multiple microservices and for authentication and authorization, we will be using IdentityServer. The content of the course will guide you through the basic blocks of Identity server and how to get it up and running.

You will learn how to build microservices in the .NET world using .NET API, Ocelot, IdentityServer, Entity Framework core, and clean architecture using the latest .NET 6!

We will develop ecommerce modules over product, shopping cart, ordering, payment, and email microservices with SQL server communicating over Azure Service Bus and using Ocelot API gateway. You can find microservices architecture and step-by-step implementation on .NET along with step-by-step development in this course with extensive explanations and details.

By the end of this course, you will have an application with seven fully working .NET-based microservices but most importantly, you will understand every line of code, how the microservices work together, and why we ended up with the final implementation.

What You Will Learn

  • Understand .NET 6 microservices architecture
  • Learn .NET API with authentication and authorization
  • Explore role-based authorization with the IdentityServer
  • Understanding IdentityServer integration
  • Learn the Azure Blob Storage basics
  • Understand Azure Service Bus - topics and queues


This course is for students looking to explore microservices with .NET core, learn communications with Azure Service Bus, and learn the basics of IdentityServer.

About The Author

Bhrugen Patel: Bhrugen Patel is a passionate and creative software engineer with a strong focus on simplicity and thorough details. He has been programming since high school and was involved with multiple web and desktop projects using .NET. He has a master’s degree in computer science and a bachelor’s degree in computer engineering. He also has many years of experience with .NET C# and .NET MVC. He enjoys teaching alongside his full-time job.

Publisher resources

Download Example Code

Table of contents

  1. Chapter 1 : Introduction
    1. Introduction
    2. Why Microservices?
    3. Course Overview
    4. Prerequisites
    5. Microservices Architecture
    6. Project Architecture
    7. Tools Needed
    8. What We will Build?
  2. Chapter 2 : Product API Basic Setup
    1. Introduction
    2. .NET 6 Change
    3. .NET 6 Nullable Change
    4. Create Project
    5. Create Product API Project
    6. NuGet Packages for Product API
    7. Configure DbContext for Product API
    8. Create Tables for Product Database
  3. Chapter 3 : Products API Advance Setup
    1. Introduction
    2. Create DTOs Inside Product API
    3. Product Repository Interface
    4. AutoMapper Configuration in Product API
    5. Product Repository Implementation Part 1
    6. Product Repository Implementation Part 2
    7. Product API Controller HTTPGET
    8. Product API Controller POST PUT DELETE
    9. Seed Products in Product API
    10. Azure Storage Explorer for Images
    11. Product Repository Interface and DTOS
    12. Base Service Interface and API Request Model
    13. Base Service Implementation
    14. Product Service in Mango Web Project
    15. Configure ProductService and HttpClient in Startup
    16. Bootstrap V5
  4. Chapter 4 : Product CRUD
    1. Introduction
    2. Product Controller Get All Action
    3. API Call Debugging
    4. Display All Products
    5. Create Products
    6. Update Products
    7. Delete Products
  5. Chapter 5 : IdentityServer
    1. Introduction
    2. OAuth2 and OpenID Connect
    3. IdentityServer Introduction
    4. V6 Duende Server
    5. Integrate QuickStart in IdentityServer Service
    6. NuGet Packages for IdentityServer
    7. DbContext for IdentityServer
    8. Configuring APIScope Resource and Clients for IdentityServer
    9. Configuring Clients in IdentityServer
    10. Configure and Run IdentityServer
    11. Seed Users
    12. Secure Product API
    13. Set Up Main Project to Use IdentityServer
    14. Login Registration Redirection
    15. Login in Action
    16. Register User from UI
    17. Token Inspection
    18. Passing Custom Claims
    19. View Modified Token
    20. Pass Token and Perform Operations
  6. Chapter 6 : Home and Details
    1. Introduction
    2. Create Index Action Method
    3. Index View Home Controller
    4. Details Get Action Method
    5. Details View
  7. Chapter 7 : Shopping Cart API Service
    1. Introduction
    2. Create Shopping Cart API
    3. NuGet Package for Shopping Cart API
    4. Set Up Startup Class File for Shopping Cart
    5. Entity Models for Shopping Cart API
    6. Create DTOs and Push Models to Shopping Cart Database
    7. Mapping Configuration for Shopping Cart
    8. Cart Repository Interface for Shopping Cart API
    9. Add to Shopping Cart Repository Method
    10. Update Shopping Cart Repository Method
    11. Implement Cart Repository Get and Remove
    12. Cart Controller for API Endpoints
  8. Chapter 8 : Consume Shopping Cart API Service
    1. Introduction
    2. Create Models for Shopping Cart API
    3. Define Cart Service Interface
    4. Configure Cart Service
    5. Details Post Action Method
    6. Demo - Add Items to Cart
  9. Chapter 9 : Shopping Cart UI
    1. Introduction
    2. Add Cart Controller
    3. Methods to Load Shopping Cart
    4. Debugging API Call to Shopping Cart
    5. Shopping Cart UI
    6. Remove Items from Cart
  10. Chapter 10 : Coupon API Service
    1. Introduction
    2. Create Coupon Project and Add NuGet Packages
    3. Create Coupon API Project
    4. Coupon Models and DTOs
    5. Coupon Repository
    6. Coupon Controller
  11. Chapter 11 : Consume Coupon API
    1. Introduction
    2. Configure Shopping Cart API with New Methods
    3. Logic for Apply or Remove Coupon in View
    4. Cart Controller and Service for Applying or Removing Coupon
    5. Demo - Apply or Remove Coupon
    6. Configure Cart Service in Main Project
    7. Demo - Calling Coupon Microservice
    8. Checkout UI
    9. DateTimePicker
  12. Chapter 12 : Checkout Functionality
    1. Introduction
    2. Checkout Message
    3. Checkout Method in Cart Service
    4. Checkout Post Action
    5. Demo - Checkout Header DTO
    6. Async Await Is Not Async Communication in the Project
    7. Synchronous Versus Asynchronous Communication
  13. Chapter 13 : Azure Service Bus
    1. Introduction
    2. Azure Service Bus Overview
    3. Create Azure Service Bus with Topic and Subscription
    4. Message Bus Interface
    5. Message Bus Sender Implementation
    6. Send Message to Topic
    7. Upgrade to Azure Messaging ServiceBus
  14. Chapter 14 : Order API
    1. Introduction
    2. Create Project
    3. Adding Models for Order API
    4. Startup File and Migrations
    5. Order Repository Interface
    6. Implement Order Repository
    7. Configure DbContext for Order Repository
    8. Create Models for Azure Messaging
    9. Process Checkout Message and Create Order Details in Database
    10. Setting Up Constants
    11. Create Service Bus Processor
    12. Set Up Auto Start and Stop for Service Bus Consumer
    13. Demo Receive Message
  15. Chapter 15 : Sync Microservice Communication
    1. Introduction
    2. Create Coupon Repository Interface
    3. Implement Coupon Repository
    4. Configure Start Up File for Coupon Repository
    5. Check for Coupon Changes
    6. Demo - Synchronous Communication and Alerts Display
    7. Synchronous Communication scenario
  16. Chapter 16 : Payments
    1. Introduction
    2. Create Payment Processor Class library
    3. Payment Flow
    4. Payment Status Models
    5. Publish Payment Message
    6. Demo - View Message for Payment Request
    7. Payment API to consume message
    8. Payment API Azure Service Bus Consumer
    9. Demo - Consume Payment Processing
    10. Demo - Consume Payment Status
    11. Demo - Complete Flow
  17. Chapter 17 : Queue
    1. Introduction
    2. Use Queue to Forward Message
    3. Use Queue for Checkout Message
    4. Add Email Microservice
    5. Set Up Email Service Project Part 1
    6. Demo - View Message for Payment Request
    7. Azure Consumer Bus for Email Service
    8. Multiple Subscribers
  18. Chapter 18 : Ocelot
    1. Introduction
    2. Ocelot Introduction
    3. Create Project
    4. Add Ocelot to the Gateway
    5. Use Ocelot to Retrieve All Products
    6. Ocelot Setup for Products API
    7. Ocelot for Other Endpoints
  19. Chapter 19 : RabbitMQ
    1. Introduction
    2. Overview RabbitMQ
    3. Exchange Types
    4. Queues
    5. Install RabbitMQ
    6. Add RabbitMQ NuGet to Project
    7. Implement RabbitMQ Cart Message
    8. RabbitMQ Send Checkout Message to Queue
    9. Set Up RabbitMQ consumer Part 1
    10. Set Up RabbitMQ consumer Part 2
    11. Demo – Consumer RabbitMQSender
    12. Optimize RabbitMQSender
    13. Publish Message from Order API
    14. Consume Message from Order API
    15. Publish to Fanout
    16. RabbitMQ Payment Message Sender
    17. Fanout Subscription Setup
    18. Demo - Fanout
    19. Direct Exchange RabbitMQ Sender
    20. Demo – Direct Message

Product information

  • Title: .NET Core Microservices - The Complete Guide (.NET 6 MVC)
  • Author(s): Bhrugen Patel
  • Release date: February 2022
  • Publisher(s): Packt Publishing
  • ISBN: 9781803247793