Bald Bearded Builder
topics/aspnetcore

/aspnetcore

Minimal APIs, middleware, dependency injection, configuration, and the parts of the request pipeline that only bite you in production.

Everything filed under aspnetcore

Article

Tame Configuration in ASP.NET Core with IValidateOptions

Silent misconfiguration is sneaky and expensive. Learn how to validate strongly typed settings in .NET using IValidateOptions, add cross property rules, inject services, support named options, and fail fast at startup with ValidateOnStart.

5 min1 like0 comments
Article

Stop Breaking Clocks in ASP.NET Core with UTC and TimeZoneInfo

Time bugs are sneaky and expensive, but they do not have to be. This post shows a practical UTC first approach for ASP.NET Core using DateTimeOffset and TimeZoneInfo. You will learn how to design your data model, return UTC from APIs, convert to a user’s local time, and avoid DST traps without hard coded offsets. We will also wrap conversions in a clean service and make time testable with TimeProvider.

4 min0 likes0 comments
Article

From Layers to Slices: How I Ship Faster ASP.NET Core APIs

Your API should feel like a collection of small, focused stories, not a scavenger hunt through Services and Interfaces. This tutorial shows how to build a feature first Vertical Slice Architecture in ASP.NET Core using Minimal APIs, MediatR, and FluentValidation. You will see how commands and queries stay tidy, how validation runs before handlers, and how the folder structure reduces friction as your API count grows.

4 min0 likes0 comments
Article

How .NET 10 speeds up API validation without code changes

Model validation has been a reliable but costly part of every ASP.NET Core request. In .NET 10 and C# 14, validation gets faster through precomputed metadata, typed execution, and fewer allocations. This post explains what changed under the hood, shows small runnable examples, and includes a micro-benchmark you can adapt. You will also see how to write lean custom validators and pair validation with faster JSON parsing.

4 min0 likes0 comments
Short

Fix Ambiguous Constructors in ASP.NET Dependency Injection!

Ambiguous ASP.NET Core dependency injection constructors can be resolved with an explicit constructor attribute, a factory, or keyed services.

0:542,872 views84 likes
Video

Dependency Injection Mistakes You Need to Avoid!

Five ASP.NET Core dependency injection failures cover missing registrations, circular dependencies, lifetime mismatches, ambiguous constructors, and scoped services used by background work.

7:578,483 views344 likes
Short

IExceptionHandler Makes ASP.NET Exceptions Easy

.NET 8's `IExceptionHandler` supports centralized ASP.NET exception handling through built-in middleware and modular handlers for specific exception types.

0:571,545 views79 likes
Video

Building Custom Middleware for ASP.NET Core

Queues, stacks, and dictionaries solve distinct C# collection problems involving fair ordering, last-in-first-out history, and fast typed lookups.

13:4112,228 views403 likes
Video

Handle ASP.NET Core Exceptions Globally

C# pattern matching can compare a boxed runtime value with a constant even when equality operators reject the incompatible static types.

9:3416,178 views602 likes
Short

Don't Make This Dependency Injection Mistake!

Injecting a shorter-lived service into a longer-lived one effectively extends the dependency's lifetime and creates invalid service designs.

1:493,713 views139 likes
Short

It's ALWAYS CORS!!!!

A live debugging attempt moves from successful compilation to a failed fetch before identifying CORS as the culprit.

0:24610 views17 likes
Video

Should my Services be Transient, Scoped, or Singleton?

.NET dependency injection lifetimes are explained through transient, scoped, and singleton services, including the risks of mutable singletons and injecting shorter-lived dependencies into longer-lived services.

3:4020,180 views771 likes
Video

MVC vs. Minimal API vs. FastEndpoints - Which is Best for Your Project?

ASP.NET controllers, minimal APIs, and FastEndpoints offer different tradeoffs in organization, dependency injection, documentation, syntax, and built-in features.

4:3925,261 views672 likes
Article

Choosing Between Controllers and Minimal API for .NET APIs

.NET now offers several methods for creating APIs. Let's cover the pros & cons of building with Controllers, Minimal API, and more.

6 min0 likes0 comments
Article

Using AutoMapper with ASP.NET Core 3

AutoMappers usage via dependency injection changed in ASP.NET Core 3. This post shows how to use the new implementation.

3 min0 likes0 comments
Article

Adding HATEOAS to an ASP.NET Core API

RESTful APIs provide a great way to make our APIs easier for users to consume. How can we make discovering endpoints and capabilities easier?

6 min0 likes0 comments