Building a Minimal API in ASP.NET Core

Can .NET finally Come Close to Go’s Simplicity?

Martin Cerruti
Geek Culture

--

Photo by Dave Hoefler on Unsplash

When the all-singing, all-dancing ASP.NET Core launched in 2016, .NET suddenly became a strong contender in performance benchmarks. Traditionally, the ASP.NET ecosystem was considered sluggish, enterprise-y, and definitely not something you’d pick for performance.

The launch of ASP.NET Core shook things up. Suddenly, there was a sensible default for Dependency Injection. Logging was no longer an afterthought. Configuration from disparate sources became manageable.

Modern ASP.NET Core applications can be fast, maintainable and following good, modern coding standards. Advanced software paradigms such as the Clean Architecture gained hugely in popularity. These factors combined make ASP.NET Core a strong choice for developing APIs.

There is one downside that’s been around from the start: the language is so damn noisy. Even for the smallest API, you’d need to bring the whole circus: MVC, Dependency Injection, Configuration, Logging, etc.

While this may be desirable for larger projects, for smaller APIs, or just getting started, this can all seem quite daunting.

In this article, you’ll learn how to build a minimal API while using the built-in mechanisms for Dependency Injection…

--

--

Martin Cerruti
Geek Culture

Software Architect, Technology Writer, but most of all a programmer.