All topics / ASP.NET Core From Zero

ASP.NET Core From Zero

Learn Microsoft's modern, cross-platform web framework: minimal APIs and your first server, routing, model binding and validation, dependency injection, the middleware pipeline, building a REST API, authentication, and testing and production. The framework behind a huge share of enterprise backends, taught mental-model-first.

  1. What ASP.NET Core Is & Your First Server ASP.NET Core is Microsoft's modern, cross-platform web framework. A request flows through a middleware pipeline to your code, which gets services via dependency injection. Build and run a minimal API.
  2. Routing & Minimal APIs How ASP.NET Core matches a request to your code: MapGet/MapPost and friends, binding route and query parameters, returning the right status with Results, and grouping endpoints with MapGroup.
  3. Model Binding & Validation How ASP.NET Core turns a raw HTTP request into typed C# parameters, and how to check those values with data annotations — including the honest minimal-API gotcha that validation isn't automatic.
  4. Dependency Injection Register services against interfaces in one place and let the framework construct and supply them. Covers the three lifetimes, constructor and handler injection, and the captive-dependency trap.
  5. The Middleware Pipeline How a request flows through an ordered chain of middleware — Use, Run, and Map — why ordering is everything, how to short-circuit, and how to write your own.
  6. Building a REST API Assemble routing, model binding, validation, and DI into a full CRUD products API — five endpoints over one collection, backed by a thread-safe in-memory repository and returning typed Results.
  7. Authentication & Authorization JWT bearer auth in ASP.NET Core: the who-then-what mental model, validating tokens, the all-important middleware order, and protecting endpoints with Authorize, policies, and roles.
  8. Testing & Production Test the whole app in memory with WebApplicationFactory and HttpClient, override services for fakes, layer configuration with appsettings and ASPNETCORE_ENVIRONMENT, then publish and ship behind Kestrel in a small Docker image.
  9. Where to Go Next You can build a real ASP.NET Core API end to end. Now the honest map: minimal APIs vs controllers, EF Core, Blazor, SignalR and gRPC, the roots, and what to build.