23 min read
EF Core Split Queries: The Hidden LIMIT Slowing PostgreSQL
EF Core split queries with SingleOrDefaultAsync hide a LIMIT subquery PostgreSQL can't optimize. One extension method took an endpoint from 5.45s to 155ms.
> topic · 20 articles
Articles about modern .NET: new framework features, performance and practical backend patterns.
23 min read
EF Core split queries with SingleOrDefaultAsync hide a LIMIT subquery PostgreSQL can't optimize. One extension method took an endpoint from 5.45s to 155ms.
12 min read
Learn how to validate options asynchronously at startup in .NET 11 with IAsyncValidateOptions and the new async Validate overloads, so your application fails fast when a configured endpoint is unreachable or misconfigured.
14 min read
Learn how to use C# 15 union types in ASP.NET Core 11 Minimal APIs. We declare unions, use exhaustive pattern matching, accept and return them as JSON, see how they show up in OpenAPI, and compare them with closed class hierarchies.
14 min read
Learn how to localize validation error messages and display names in .NET 11 Minimal APIs using the built-in localization support in Microsoft.Extensions.Validation, resource files, convention-based keys, and custom attributes.
13 min read
Learn how to use the new async validation support in .NET 11 Minimal APIs with AsyncValidationAttribute and IAsyncValidatableObject to run database-backed validation rules before your endpoint handlers even execute.
10 min read
Learn how to call Azure OpenAI from a .NET application. From the SDK installation and the difference between deployment names and model names, to API key authentication, standard completions, and streaming with Server-Sent Events.
6 min read
Endpoint filters in ASP.NET Core Minimal APIs let us run cross-cutting logic before and after handlers execute — without touching the handler itself. Here's how they work and when to reach for them.
11 min read
FluentValidation vs .NET 10 built-in validation — I ran a real BenchmarkDotNet test across 1,000 sequential and parallel requests to see which is faster in ASP.NET Core Minimal APIs.
14 min read
Learn how to validate incoming requests in .NET 10 Minimal APIs using data annotations, custom validation, and built-in ProblemDetails responses using this complete guide paired with practical examples.
4 min read
Discover how to organize Minimal API endpoints using simple extension methods. This straightforward approach keeps your Program.cs clean without the complexity of reflection, making it perfect for small to medium-sized APIs where explicit registration is preferred.
11 min read
Learn how to automatically register Minimal API endpoints in .NET using reflection. This approach keeps our Program.cs clean and scalable as our API grows, eliminating repetitive route definitions and enabling convention-based endpoint discovery through assembly scanning and service descriptor registration.
9 min read
Prevent lost updates with optimistic concurrency in EF Core: use a DateTime concurrency token instead of RowVersion, handle DbUpdateConcurrencyException and return 409 Conflict.
7 min read
Explore how to use Endpoint Filters in ASP.NET Core Minimal APIs to handle cross-cutting concerns while keeping your endpoint logic clean, maintainable, and DRY.
6 min read
EF Core 10 finally lets us define multiple named global query filters per entity and turn them off one at a time with IgnoreQueryFilters(). Here's how it works in practice.
6 min read
Document the response types of ASP.NET Core Minimal APIs for OpenAPI: manually with Produces<T> and ProducesValidationProblem(), or automatically with TypedResults.
5 min read
Rate limiting is a technique used to control how many requests a client can make to an API within a certain timeframe. In this article, we will explore how to implement rate limiting in .NET Minimal APIs using the built-in middleware, focusing on the Fixed Window strategy and applying limits per endpoint.
7 min read
API key authentication is a common approach to securing APIs by requiring clients to provide a unique key with each request. In this article, we will explore how to implement API key authentication in .NET Minimal APIs while supporting multiple API keys.
2 min read
Minimal APIs, the streamlined, lightweight approach to creating APIs in .NET, offer a perfect blend of simplicity, flexibility, and power. Whether you’re new to API development or a seasoned developer looking to refine your skills, this course has everything you need to take your expertise to the next level.
10 min read
Learn how C# primary constructors work for classes and structs, how they differ from records, and the pitfalls to avoid, like mutable parameters and double capture.
11 min read
Learn how to use Azure Key Vault in .NET: authenticate with DefaultAzureCredential, read and create secrets with SecretClient, and load them straight into IConfiguration.