
Learn what microservices are and gain hands-on experience building seven small APIs in .NET Core, including an authentication API with Dotnet identity, and explore inter-service communication.
Explore building a full microservice e-commerce app with multiple APIs and a web client, including product catalog, shopping cart, coupon codes, email and rewards microservices, and Stripe payment integration.
Build small apis with net core, implement authentication with net identity and CRUD via entity framework core, and explore azure service bus, Ocelot gateway, and azure deployment with best practices.
Discover how microservices enable independently deployable, scalable architectures with smaller codebases and fault isolation that keep the app running when a service fails.
Explore how microservices are loosely coupled, independently deployable apis that communicate via rest calls or message brokers, with separate databases and varied tech stacks, unlike monolithic apps.
Explore a microservices architecture with databases for product, coupon, shopping, cart management, email, and rewards, plus an identity JWT service and gateway routing with synchronous calls and service bus messaging.
Outline the required tools: Visual Studio with NET eight (preview) or NET seven, SQL Server and SQL Server Management Studio, and an Azure subscription for service bus-based API communication.
Clarify what this course is not about, focusing on microservice fundamentals and API communication, while avoiding Docker and keeping a stack with dotnet APIs, Entity Framework Core, and SQL Server.
Establish prerequisites for this course by understanding dotnet core, mvc, and web app basics. Learn entity framework core, CRUD operations, and dotnet APIs, or take the dotnet mastery course first.
Learn how to access and download project resources for the .NET Core microservices course, including PowerPoint presentations, images, GitHub code, and code snippets in the net eight course.
Create an empty ASP.NET Core project in Visual Studio to form an empty solution for a net eight microservices architecture, deleting the temporary project and organizing folders.
Organize your solution by creating a clear folder structure: add front end, gateway, integration, and services folders to host the MVC web app, messaging components, and microservice endpoints.
learn to add Swashbuckle to a .NET 9 api project and enable open api support. configure program.cs to register swagger and update launch settings so swagger ui loads by default.
Create a coupon api endpoint in a dotnet 8 asp.net core web api project with controllers to enable coupon codes for products. Configure launch settings to run on port 7001.
Create a coupon model with id, code, discount amount, and minimum amount for CRUD operations, then add a coupon DTO mirroring the model to manage API responses.
Install and configure AutoMapper with dependency injection to map coupon DTOs to entities, then set up SQL Server backing via Entity Framework Core and necessary NuGet packages, including migrations.
Create an app db context that implements DbContext and exposes a coupons DbSet; mark couponID as primary key and coupon code and discount amount as required in program.cs.
Configure the application db context in program.cs with entity framework core for sql server, using the default connection string from appsettings.json, and create the coupons table via migration.
Seed the coupons table with Entity Framework Core by overriding OnModelCreating and using ModelBuilder.HasData, then seed records and apply migrations automatically on startup.
Build a coupon api controller with get all and get by id endpoints using entity framework core and app db context, with swagger-ready routes.
Implement a common response DTO with a result, isSuccess, and message, and apply it across all API endpoints to ensure a consistent response format and error handling.
Configure AutoMapper to map between coupon and coupon dto, including lists. Create a mapping config, register the mapper as a singleton, and inject it via dependency injection.
Implement coupon api CRUD endpoints in dotnet 8 mvc: get by code with case-insensitive matching, create, update, and delete coupons using dto mapping and entity framework core.
Create an ASP.NET Core MVC web app named mango.web to consume the coupon API, selecting none authentication for the front-end project.
Create request and response DTOs and an enum for api type to standardize api calls in the web project, defining url, data, and an optional access token.
Define a dynamic base service interface for aggregating API calls, with an asynchronous send method that accepts a request dto and returns a response dto for coupon and other APIs.
Implement a base service with http client factory to call APIs, using a request DTO and JSON serialization, and return a response DTO while handling common status codes.
Create a coupon service interface to call the coupon api. Define async methods for get by code, get all coupons, get by id, create, update, and delete.
Register the coupon service in program.cs with dependency injection and an http client, configure base service for http requests, store coupon api base in appsettings, and register services as scoped.
Implement and secure the coupon service CRUD endpoints in a .NET Core microservice using async methods, including get all, get by code, get by id, create, update, and delete.
Configure a multi-project startup to run the coupon API and web app, then apply a Bootswatch slate theme and Bootstrap icons to enhance the UI.
Implement a coupon controller in an mvc project to consume the coupon service and retrieve coupons asynchronously, deserializing to a list of coupon dto objects for the view.
Debug an API call by introducing a deliberate bug to reveal a route mismatch, then fix it by hardcoding the root as API forward slash coupon for consistent routing.
Create the coupon index view using provided snippets, bind it to an enumerable of coupon dto, and render coupon code, discount amount, and minimum amount in currency.
Create a new coupon via an ASP.NET Core MVC flow by building coupon create view, wiring a coupon controller action, using a coupon DTO, plus client-side validation with jQuery validation.
Implement post create action for coupons with server-side validation, call coupon service create coupon async, and redirect to coupon index on success; return the view with the model if invalid.
Pass the coupon id via asp route tag helper to the delete action, fetch the coupon by id, and display a delete view with a post action to remove it.
Debug the delete coupon flow, fix missing id in the root for the coupon controller, and verify http delete works; crud for coupons is functional, with update not implemented yet.
Integrate toaster notifications by adding the CDN scripts and styles, creating a shared _notifications partial, and using TempData to show success and error messages.
Create an auth API using dotnet identity for secure microservice endpoints, add a new project, and install and transfer NuGet packages (EF Core and AutoMapper) from the coupon API.
Configure net identity in the auth API with EF Core, using identity user and role, install the identity EF Core package, and apply migrations to create the mango_auth identity tables.
Extend the identity user with a custom ApplicationUser, add a name property, update the DbContext, switch to ApplicationUser, and apply a migration to add the name column.
Create an auth api with an api/auth route, remove the default weather forecast, and implement two http post endpoints for register and login, then run and verify them.
Define auth dto models for register and login, create a user dto with id, email, name, and phone, and add a login response with a jwt token.
Configure JWT options by storing the secret key, issuer, and audience in appsettings.json under API settings, mapping them to a JWT options class, and injecting them via configuration in Program.cs.
Define an IAuth interface with login and register DTOs, then implement the auth service. Use dotnet identity helpers, user and role managers, and dependency injection to handle registration and login.
The register endpoint in the auth service creates a new application user from the registration request dto, hashes the password with net identity, and returns a user dto on success.
Register in action shows a register endpoint that returns an empty string on success or an error message with identity errors, using an auth service and a response DTO.
Implement login in the auth service by validating credentials with a username lookup, checking the password, and generating a JWT token in the login response.
Implement a jwt token generator to issue a token for the logged-in user. Configure claims, secret key, issuer, and audience, then build the token with a token descriptor and handler.
Inject the jwt token generator into the auth service and generate a token with user id and email claims, using configured jwt options and validating issuer and audience.
Implement a role assignment endpoint by creating roles in the asp.net roles table, mapping users with asp.net user roles, and assigning admin or customer roles based on email.
Copy all auth API DTOs into the web project and rename their namespace to mango.web.models, then configure the auth API base URL (port 7002) in app settings and in program.cs.
Create an auth service in a web project with login, register, and assign role endpoints using DTOs, implemented via a base service and dependency injection.
Create an mvc auth controller in a web project to support login and register endpoints, inject the art service, and update the nav bar based on user authentication.
Create login and register views for the endpoint, using login and registration request DTOs, post forms, and an asp validation summary, styled with container, row, and form controls.
Add a role dropdown to the registration form by defining admin and customer constants, building a role list of select list items, and rendering via view bag.
Implement post register action that calls the auth service with a registration request DTO, registers the user, assigns a role (from dropdown or defaulting to customer), and redirects to login.
Implement login by configuring login request and response DTOs, deserializing the response to obtain the token, and redirecting to the home index; handle errors as a model state error.
Implement a token provider that stores and retrieves the JWT token in cookies using IHttpContextAccessor, with set, get, and clear methods, and register it as a scoped service.
Inject the token provider via dependency injection and sign in the user with cookie authentication, building a claims principal from the JWT to establish authentication.
Register cookie authentication in the service container and enable authentication in the request pipeline before authorization. Implement logout by signing out via http context and redirecting to the home index.
Add roles to tokens to enable authorization in a .NET 8 microservices app. Fetch user roles, map to claim types, and generate tokens with role claims for access control.
Implement required field validation for login and registration in a net 8 mvc app by updating login and registration dtos, enabling scripts, and displaying error messages via toaster.
Enable authentication in the coupon API by configuring JWT bearer tokens, validating issuer, audience, and signing key in program.cs, and enforce authentication before authorization to prevent internal server errors.
Configure swagger gen for bearer token authentication in a coupon API, add security definitions and requirements, and authorize with a token obtained from the auth API.
Pass the JWT token to API calls by setting an authorization header with a bearer token from the token provider, using withBearer true, and bypassing it for login or registration.
Refactor the coupon API by moving authentication into a dedicated extension and folder, reducing program.cs clutter and enabling a static web application builder extension for authentication and login.
Demonstrate role-based security for coupons by enforcing admin-only create, update, and delete actions, with customer access and access denied cases across the API and web project.
Create a net eight web api for the product service, implement product model and dto, set up crud with seeding, copy coupon api package references, and use online image urls.
Build a complete product api with migrations, db context, and auto mapper; implement CRUD with auth; seed five records; prepare web app integration on port 7000 and product views.
Clone and adapt the coupon api to build a product api, updating namespaces, mappings, and app settings, then configure mango underscore product, migrate, seed data, and test crud calls.
Set up a product API client in the web project by renaming coupon to product, add product DTOs and service, and configure the product API base URL and DI.
Implement authorized product crud operations and consuming product api in a .NET core mvc app, including create, edit, delete, and their views, with a hidden id and access control.
Inject the product service into the home controller index action to fetch all products for the home page, and remove the authorization tag to enable get access in API controller.
Display all products on the home page by looping through the product model and rendering name, image, price, category, and description. Link to the details action with the product ID.
Implement details get action to fetch a single product by id and pass a product DTO as the model. Enforce authorization so only logged-in users can view the details page.
Rename details action to product details, add the view, and wire into index; define a product dto and render content: name, price as currency, image url, category, and description html.raw.
Add a count field to the product details view via a DTO, default to one, validate 1–100 with data annotations, and prepare a database-backed cart API for promotions and redirects.
Create an ASP.NET Core Web API project for the Shopping Cart API, named Mango Dot Services dot Shopping Cart API. Use existing NuGet packages.
Create cart header and cart details tables with primary key and user reference; store coupon code, mark cart total and discount as not mapped, and define DTOs for API exposure.
Set up the Mango shopping cart api by removing the weather forecast, configuring project files and namespaces, adding cart header and detail migrations, and updating app settings.
Create a cart api controller by configuring a single async post endpoint at /cart that injects AutoMapper and DbContext, processes a cart DTO, and returns a response DTO.
Implement a cart upsert endpoint that creates cart header and details for new carts, adds or updates items in existing carts, and uses try-catch to handle errors.
Upsert logic for shopping cart: create and update cart header and cart details, handle no-tracking queries to avoid EF Core tracking errors, and apply a DTO-based update with save changes.
Create an endpoint to remove a card detail by its id from the request body, then remove the card header when it's the last item, and save changes.
Implement the endpoint to retrieve a user’s shopping cart via a get action, populating header and details from the database and calculating the cart total.
Discover how microservices communicate by loading a shopping cart and retrieving product details through http calls from the shopping cart to the product api via an http client.
Learn how to call an external product api from the shopping cart service by configuring an http client, loading all products, and enriching cart items with product data.
Add and test apply coupon and remove coupon endpoints in the cart API, updating the cart's coupon code by user id, saving changes asynchronously, and verifying via database.
Build a coupon service using HTTP client factory to call the coupon API by code and apply the discount to the cart total when eligible.
Configure the web project to consume the shopping cart API, map cart DTOs, and implement the cart service with get cart by user id, upsert, remove, and apply coupon.
Implement a cart controller with dependency injection and an authorized, async index action that loads the cart for the logged-in user via the cart service.
Debug a shopping cart feature by correcting the endpoint path from coupon to api/card, resolve not found and null cart errors, and enable adding items to the cart.
Add items to the shopping cart by posting product details to the cart API and upserting a cart DTO with header and details using dependency injection.
Design and implement the cart index view in a .NET Core MVC app, render dynamic cart details (image, name, description, price, count) with HTML and CSS, and enable item deletion.
Implement shopping cart functionality in .NET core mvc by applying and removing coupons, displaying the order total and discount, and wiring cart actions in the controller.
Learn to use a delegating handler to pass the bearer token from the shopping cart API to the coupon API by retrieving the access token and setting the authorization header.
Fixes a shopping cart bug by validating cart header and items before display, showing a prompt when empty and applying the ten off coupon only after meeting the $20 minimum.
Distinguish async/await in code from asynchronous microservices communication; explain that await waits for a response, making it effectively synchronous, and preview implementing true asynchronous microservice communication in the next video.
Explain synchronous and asynchronous communication in microservices, showing wait-for-a-response versus request-and-forget patterns. Contrast shopping cart waits for product data with asynchronous email processing via a service bus.
Learn to implement an asynchronous email workflow using a dedicated email service, SendGrid integration, and Azure service bus to queue cart emails, log processing in a database, and ensure reliability.
Create an Azure service bus in the portal, choose standard pricing, and learn to work with queues and topics, including the mango web service bus.
Create a service bus queue email shopping cart, configure delivery count, lock duration, time to live, inspect dead letters, and establish an integration service to post to a topic.
Create a mango dot message bus class library to publish messages to the service bus, and implement an async publish message interface with topic_queue_name and object message.
Implement a public message bus class that implements the interface, serializes messages to JSON, and sends via a service bus sender to a queue or topic using a connection string.
Publish a shopping cart message to the service bus by adding an email cart endpoint, using iMessageBus to post the cart DTO to the email shopping cart topic or queue.
Add an email field to the cart header dto and populate it from the logged in user’s email claim, then pass cart details to email service for sending and logging.
Is your project or your team suffering from the drawbacks of a Monolithic application? or are you one of those developers who have heard the buzz word about Microservices but you don't know where to start from? or are you wondering if a microservices architecture is the right fit for your .NET project? or are you tired of other courses where they give you a good start but halfway through the course you wonder what is going on and nothing makes sense!
If so, then this is the perfect course for all of your questions!
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 and for authentication and authorization we will be using .NET Identity!
Learn how to build Microservices in the .NET world using .NET API, Ocelot, .NET Identity, Entity Framework Core and clean architecture using the latest .NET 8!
You will develop e-commerce 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 which step by step developing this course with extensive explanations and details.
Along with this you’ll develop following microservices and items:
Product Microservice
.NET Identity Microservice
Coupon Microservice
Shopping Cart Microservice
Order Microservice
Email Microservice
Payment Microservice
Ocelot Gateway Project
MVC Web Application
On top of all these, you'll learn how to write quality code, not just how to build microservices. In this course you will see the demonstrating a layered application architecture with best practices.
Is this course for you?
If you are the developer who likes to get hands dirty with programming this is the perfect course! I love to code from scratch and explain the basics, so that is a main considering for this course as well! This course is very practical, about 90%+ of the lessons will involve you coding along with me on this project.
By the end of this course, you will have an application with 7 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.