
Explore the fundamentals of ASP.NET Core for backend development, from host and middleware pipelines to MVC, Razor views, and minimal API routing on the dotnet platform.
Learn to use the dotnet CLI with Visual Studio Code to create, build, and run .NET projects. Explore templates, languages, SDK versions, and global.json for ASP.NET Core backend work.
Explore how ASP.NET Core, a cross-platform open-source web framework on the dotnet platform, powers dynamic web apps, web APIs, and real-time experiences.
Create a minimal ASP.NET Core project from scratch using the dotnet web sdk, write the csproj and program with top level statements, and expose a hello world endpoint at /.
Explore bootstrap approaches for ASP.NET Core, from web host and generic host to the minimal hosting model, and learn when to use each for web and background apps.
Explore essential asp.net core app files, from csproj and appsettings.json to program.cs and startup.cs, and understand service registration, middleware, and the initialization sequence.
Explore how the generic host manages the application lifecycle, startup class configuration, a centralized dependency container, and web support with web host defaults and the request processing pipeline.
Examine the generic host concept with web and background hosted services, dependency injection, and logging, and see a background order notification service built atop it.
Explore how the project uses mvc with models and controllers in a backend web api, using postgres and plain sql for product, shopping cart, and shopping cart item models.
Follow the README to set up ASP.NET Core backend, spin up a Postgres docker instance, run SQL to create products and carts, then start the app and test with Postman.
Explore hosting models for ASP.NET, comparing traditional IIS with ASP.NET Core's Kestrel server. Understand in-process versus out-of-process hosting and why production apps use a reverse proxy for horizontal scaling.
Explore asp.net history, benefits, and the move from dotnet framework to dotnet core and unified. Examine a typical asp.net core app structure, program.cs, startup.cs, and kestrel.
Explore the ASP.NET Core request processing pipeline, where Kestrel creates HttpContext and passes it through a middleware chain of logging, authorization, and MVC, including possible short-circuiting.
Explore how to create and register middleware in the ASP.NET Core request pipeline (program.cs or startup.cs) using app.Use, built-in middlewares, and pre-processing and post-processing, highlighting registration order.
Learn how anonymous inline middleware in ASP.NET Core logs requests and responses with elapsed time, using a logger from the injection container, and pre- and post-processing around the next delegate.
Learn how to implement a conventional HTTP logging middleware in ASP.NET Core, using a dedicated class, request delegates, and dependency injection, while understanding singleton lifecycle and scoped service constraints.
Explore factory-based middleware in ASP.NET Core, implementing the middleware interface, leveraging the built-in middleware factory and the DI container to resolve instances at request time, with singleton or scoped lifetimes.
Configure http logging middleware with the options pattern to conditionally log the user-agent via startup configuration and appsettings, using IOptions and the Configure method.
Register a factory-based http logging middleware with explicit dependencies, using extension methods to encapsulate DI configuration and pipeline registration for reliable, well-structured middleware behavior.
Parse the user agent at the start of the request using a third-party parser to build a client metadata object (device, operating system, browser), then expose it via HttpContext.Items.
This lecture teaches using HttpContext.Items to share client metadata between middlewares with strongly typed storage items, via generic set/get extensions and a storage item abstraction for safer, type-safe access.
Explore how HttpContext exposes modular features via the features collection, access request headers, and how middleware adds or uses features like WebSocket and HTTP activity in ASP.NET Core.
Learn how ASP.NET Core streams responses with chunked transfer encoding, why you must set status codes before writing, and how the has started state and single transmission mode shape behavior.
Compare inline, convention-based, and functor middleware approaches in the ASP.NET Core request pipeline, and leverage dependency injection, options-based configuration, and typed HttpContext usage.
Explore the mvc architectural pattern within ASP.NET Core, detailing model, view, and controller roles, data handling, validation, and how the controller mediates requests to generate final html markup.
Master mvc controllers as classes inheriting from controller; use action methods and http verbs with attribute routing to map routes, exemplified by a messages controller and hello world endpoint.
Learn to refactor an ASP.NET Core app by moving data operations from controller to model, align with MVC separation of concerns, and implement asynchronous get methods returning IEnumerable.
Explore adding views in MVC to a web API by building a home controller and index cshtml, delivering a simple static landing page using a static files directory.
Explore razor syntax to embed C# in HTML with the at symbol, making the year dynamic in views. Use implicit and explicit expressions and razor blocks for server-side rendering.
Create an admin products page in ASP.NET Core by declaring a model in the view, wiring an admin controller, and rendering a table of products.
Explore how a view engine generates HTML from templates and dynamic data, with a focus on Razor as the default view engine in ASP.NET Core and Cshtml syntax.
Explore how the Razor view engine renders cshtml templates in ASP.NET Core, using the Razor SDK and source generator to produce Razor page classes that render final HTML.
See how Razor creates views at compile time from cshtml templates and the MVC framework renders them at runtime by executing the view results to produce HTML.
Create a shared layout view in ASP.NET Core to remove duplicated header and footer, and inject content with render body. Use sections and view data to customize titles across views.
View start provides a template that runs before each view to set a default layout for all views, reducing duplication. Subdirectory view starts override parent declarations, allowing directory-specific layouts.
Learn to serve PDF manuals in ASP.NET Core using action result types: files, including virtual and physical file results, with 404 handling and MVC routing to a manuals directory.
Learn how ActionResult data is serialized to JSON or XML, and how MVC defaults and explicit formatters shape API responses.
Explore the MVC request lifecycle in ASP.NET Core, from router middleware dispatch to the controller action, through filters, model binding, action execution, and result rendering.
Explore how MVC filters execute asynchronous operations and custom logic at stages of the MVC request lifecycle, enabling authorization, error handling, logging, input validation, and dependency injection in ASP.NET Core.
Demonstrate implementing and registering authorization, action, resource, exception, and result filters in ASP.NET Core, with global registration, console logging, and tracing the MVC flow and endpoint middleware.
Register globally a resource filter near the middleware pipeline to log requests and responses, capturing controller and action names, client IP, path, and request id within the MVC request lifecycle.
Demonstrate type-based vs service-based filter registration, showing how the DI container resolves a logging filter per request and manages lifetimes with scoped registration.
Learn to measure action method performance in ASP.NET Core by implementing a benchmark filter with action filters, registering via service or type filter, and applying at action or controller level.
Implement a local in-memory cache for the products endpoint using a cache-aside pattern. This method reduces database load and improves response times.
Discover how to build a custom middleware pipeline inside the MVC request lifecycle and apply it to a specific action with the middleware filter attribute, plus its limitations.
Understand how endpoint routing unifies mvc actions and custom endpoints by mapping controllers, replacing the legacy use mvc router middleware with a single router.
Explore Razor Pages as a page-based model for building simple web apps, where each cshtml file has its own code behind, contrasting MVC's controllers and actions with Razor view engine.
Learn how the MVC extension method registers controllers with views and razor pages, and why a lighter setup uses add controllers (with or without views) for API-only scenarios.
Replace api controllers to inherit from controller base to avoid view related context, enabling data handling without views. Use controller only for mvc with views to keep separation of concerns.
Decorate a controller with the ApiController attribute to enable automatic validation responses and problem details, and validate input via model state to return 400 or 404 with validation problem details.
Learn to implement API versioning in the MVC layer with the ASP versioning MVC package, using URL versioning to maintain backward-compatible endpoints.
Transform the app into a web api by removing views, static files, and related controllers, then introduce a base api controller and versioned derived controllers while registering memory cache.
Explore the ASP.NET Core MVC architecture, including model-view-controller roles, Razor view engine, endpoint routing, and API versioning for server-side rendering and API development.
Discover minimal APIs as an official alternative to controller-based APIs in ASP.NET Core, reducing MVC overhead with route-based endpoints in the minimal hosting model.
Explore the web application class as a minimal bootstrap for ASP.NET Core, replacing startup.cs with program.cs, configuring services and middleware, and using endpoint routing with map controllers and map get.
Master implicit global usings across sdk layers and top-level statements to simplify program.cs as the entry point, then configure editorconfig and use dotnet format to remove unused usings.
Explore migrating from MVC controller-based APIs to minimal APIs, focusing on endpoint routing, route handlers, and versioning in the v3 dev products endpoint.
Explore organizing routes with map group in ASP.NET Core minimal APIs by creating a main API v3 group with products and shopping cart subgroups.
Learn to use reflection to discover and map endpoints at runtime in .NET by loading endpoint types from the current assembly and instantiating them with Activator inside an extension.
Explore how minimal apis return a result type via the results factory, including not found and ok. Compare with mvc action results and learn to craft problem details when needed.
Explore strongly-typed results in ASP.NET Core endpoints using results factory and HTTP results. Learn safer return types, OpenAPI clarity, and how minimal APIs support multiple return types.
Learn how an http request flows through minimal API endpoints, detailing parameter binding, the endpoint filter pipeline, and json response creation via the json formatter.
Explore migrating MVC filters to minimal APIs by moving logging and caching logic into endpoint filters and middleware, highlighting pre- and post-processing, memory cache usage, and endpoint-specific filtering.
Enables robust input validation in ASP.NET Core by applying data annotations for MVC and Minimal API, illustrating 400 bad request, validation rules, and problem details formats.
Move validation logic from route handler to an endpoint filter in the minimal API. Access the bound model during parameter binding and return a validation problem when input is invalid.
Implement API versioning for both controller-based and minimal API endpoints in ASP.NET Core, configuring version sets, mapping groups, and validating versions via requests and headers.
Refactor the asp.net core backend by extracting route handlers into private static methods, using typed results, and applying endpoint filter extensions to caching and validation.
Compare controller based APIs with route based minimal APIs in ASP.NET Core, highlighting web application class, top level statements, map group, endpoint filters, and typed results with validation and versioning.
Master dependency management and inversion of control with a central IOC container. See how dependency injection enables explicit dependencies and supports unit testing with mocks.
Examine how services apply the repository pattern, with a sql command executor and sql connection factory, while enforcing single responsibility principle and dependency inversion in a dependency-managed architecture.
Use the dotnet built-in IoC container to register and resolve dependencies. Register sql command executor, sql connection factory, and repositories as singletons to enable inversion of control.
Explore the service locator pattern within ASP.NET Core, showing how the IOC container resolves dependencies on demand, and contrast it with dependency injection as the preferred approach.
Explore explicit dependencies and dependency injection in ASP.NET Core, contrast with service locator, implement constructor, method, and property injection, and learn when to inject into controllers, services, and views.
Discover dependency inversion by refactoring a product repository to depend on an interface instead of a concrete class, enabling runtime switching via the IoC container and mock data.
Register services with singleton, transient, and scoped lifetimes to control instance creation and disposal. The container assigns scopes per request, sharing singletons across scopes while isolating scoped instances.
Explore service lifetimes in dotnet - singleton, scoped, and transient - through a practical console app, showing lazy instantiation, per-scope instances, disposal, and root versus child scopes.
Learn how to pick the right .NET service lifetime by evaluating stateless versus stateful behavior, dependencies, and capture scenarios, with examples of singleton, scoped, and transient patterns.
Learn implicit service registration for minimal APIs by discovering endpoint classes via reflection, registering them in the container, and mapping them to the router, enabling dependency injection for endpoint handlers.
Explore inversion of control and its container, service locator, and dependency injection; learn runtime switching between real and mock repositories via IProductRepository, plus service lifetimes and minimal APIs.
Apply your new knowledge to build or maintain backend applications with ASP.NET Core, and practice, mentor others, using the provided resources to stay up to date in the dotnet ecosystem.
ASP.NET Core is a modern, cross-platform framework for building web applications on the .NET platform.
This course will guide you through ASP.NET Core backend development from the ground up. You don’t need any prior experience with ASP.NET Core — just basic C# knowledge is enough to get started.
You'll learn through a mix of theory and hands-on coding. Before jumping into code, I’ll explain each concept with clear visual slides. We follow a problem-first approach: identify an issue, understand the “why,” explore the solution and then implement it in code.
Here's what you'll learn:
The building blocks of ASP.NET Core
Understand the core concepts behind an ASP.NET Core application — hosting, startup approaches, middleware pipeline, request handling and the role of the Generic Host.
Razor Views Basics & Rendering Engine
Build dynamic UI with Razor syntax and learn how views work under the hood. Understand model binding, layout structure and how the Razor View Engine renders views efficiently at server side.
Controller-based Web APIs using MVC Framework
Learn how to build APIs using the mature MVC Framework. Work with controllers, actions and filters to create structured endpoints.
Router-Based Web APIs using Minimal APIs
Explore the lightweight Minimal API approach. Define endpoints directly, use route groups, endpoint filters, and strongly-typed results to create clean and focused APIs.
Dependency Management & Inversion of Control
Dive into .NET’s built-in IoC container. Learn service lifetimes, service locator and dependency injection patterns, and how to design loosely-coupled applications using modern dependency management principles.
The principles behind, plus useful tips and good practices
Go beyond syntax — understand why we implement things that way. Learn industry practices, practical design tips, and avoid common mistakes.
You'll also get a quick introduction to the .NET CLI for those who prefer command-line tooling.
The course structure
This course is not just about writing code. It’s about thinking like a developer who understands ASP.NET Core from the inside out.
Imagine this: you’ve just joined a company and you’re handed a poorly structured ASP.NET Core Web API application. Your job? Clean it up, improve it and keep building on it — all while learning the framework's internals along the way. On the way, we will also have tasks from the stakeholders, like Product Managers.
That’s exactly how this course is structured.
We’ll treat this broken codebase as our playground — discovering problems, understanding the "why" behind them, and then fixing or improving them using modern ASP.NET Core practices. It's a mix of pair programming, guided walkthroughs, and visual slide explanations to help you really absorb how ASP.NET Core works under the hood.
Honest scope: We will cover only the ASP.NET part of the project. Therefore we won’t pretend the final app is “production-ready.” But you’ll walk away knowing how to get it there.
What makes this course different?
Concept-first approach: We go beyond just the “how” and focus on the “why” — helping you understand the reasoning behind each decision.
Theory + Practice: You’ll alternate between hands-on coding and clear, visual explanations that reinforce each concept.
Tackle complexity gradually: We’ll build your understanding layer by layer — starting from low-level middleware pipelines, then moving to higher-level MVC and Minimal APIs, and finally tackling side components like dependency injection.
Not just copy-paste tutorials: This isn’t a follow-along project. You’ll be encouraged to think critically, solve real problems, and truly understand what you’re building.
By the end of this course
You'll be able to build your own ASP.NET Core Web API applications — not just by following steps, but by understanding how everything works under the hood. Eventually, this will enable you maintain ASP.NET applications and troubleshoot issues effectively and make the right decisions when working with ASP.NET Core features.