Blog
Posts and series that take software and IT from the basics to advanced topics: from programming languages and databases to architecture and AI.
Recommended before this series: Object-Oriented Programming in C#, LINQ, Asynchronous Programming in C#
What's New in .NET 11: Async Validation, OpenAPI 3.2 and C# 15 Union Types in ASP.NET Core
.NET 11 STS brings async validation and localized messages to minimal APIs, [ShortCircuit], C# 15 union types, OpenAPI 3.2 with QUERY and itemSchema, removed APIs and support until 2028-11-14.
Working with HttpContext, HttpRequest and HttpResponse: Headers, Cookies, Query, Body, Items and Features
In ASP.NET Core, HttpContext is the whole request: the request's headers, cookies, query and body, the response's status code, headers and cookies, Items, Features and RequestAborted. With real outputs we read the body twice, hit the error of adding a header after the response has started, get the right client IP behind a proxy and look at the risks of IHttpContextAccessor.
Minimal APIs in Depth Part 1: Parameter Binding Sources, Custom Binding (TryParse/BindAsync), [AsParameters], Forms and IFormFile
A minimal API decides where a parameter comes from in a fixed order: attributes, special types, BindAsync, TryParse, services and finally the body. We bind an ISBN to a type with TryParse, use BindAsync and [AsParameters], and see antiforgery in form binding and case-sensitive enum binding with real outputs.
Minimal APIs in Depth Part 2: Route Groups, Endpoint Filters, the TypedResults Catalog and OpenAPI Metadata
Route groups let you write shared settings once, endpoint filters wrap the handler and can short-circuit, and TypedResults make the result show up in the OpenAPI document. We build Bookstore's /api/orders area with MapGroup, idempotency through a filter factory, our own IResult, XML comments and transformers.
JSON, Content Negotiation and Formatters: JsonOptions, Enums, Nulls, XML, a CSV Output Formatter and JSON Patch
In ASP.NET Core, minimal APIs read JSON settings from ConfigureHttpJsonOptions and controllers from AddJsonOptions; unless you set both from one place, the same enum comes out as a string on one side and a number on the other. With real outputs we cover the web defaults, nulls and cycles, source generation, content negotiation, our own CSV formatter and safe JSON Patch.
A Catalog of Built-in Middleware: Response Compression, Request Decompression, Request Timeouts, Status Code Pages, URL Rewrite and Header Propagation
Added in the right order, ASP.NET Core's built-in middleware (response compression, request decompression, request timeouts, status code pages, URL rewrite, host filtering, header propagation) gives every API response a consistent shape. We add each one to the Bookstore API, show its effect with curl and see how a middleware that answers before CORS breaks the preflight.
Localization in Web APIs: Accept-Language, RequestLocalization, Localized Validation and ProblemDetails Messages
Localization in an ASP.NET Core Web API means determining the request culture from Accept-Language, the query string or a cookie and producing the human-readable texts (validation and ProblemDetails messages) per language, while machine fields such as type, code and error keys never change. On .NET 10 we make Bookstore's institutional order endpoint TR/EN with resx, IStringLocalizer and ErrorMessageResourceType.