Combining source-generated Minimal API registration with constructor injection
Source generation can register injectable Minimal API endpoint classes and map their routes without runtime scanning or manual composition.
Source generation can register injectable Minimal API endpoint classes and map their routes without runtime scanning or manual composition.
Constructor injection keeps Minimal API handler tests focused as endpoint dependencies grow.
Most ASP.NET Core projects generate OpenAPI from code. This post explores the opposite approach: treating the spec as the source of truth for Minimal APIs.
Manual registration of Minimal API endpoints can clutter your ASP.NET Core apps. This article explores how to automate it for a cleaner setup.