All posts with Tag ASP.NET

Comparing the performance between the Minimal API and classic Controllers

Today, we are going to benchmark the performance of the Minimal API in ASP.NET 9 (and for reference against ASP.NET 8 as well) against the classic Controllers. We will test a few scenarios and check how the performance of the Minimal API compares to the classic Controllers. Let's get right into it!

Read the whole article

Preview image blogpost

Swagger Replacement in ASP.NET 9

You might have heard that Swagger is removed in the templates of ASP.NET 9. So this blog post will show you alternatives.

Read the whole article

Preview image blogpost

Managing TaskCancellationTokens in a central service in ASP.NET

In async code it is very common to pass a CancellationToken to the method that is being awaited. This allows the caller to cancel the operation if it is no longer needed. But this will lead to some ceremonial code that is repeated in every method. In this article I will show you how to manage CancellationToken in a central service in ASP.NET.

Read the whole article

Organizing Parameters in Minimal API with the AsParametersAttribute

Even though it was introduced in .NET 7, I came across recently the AsParametersAttribute. Let's have a look what it is good for.

Read the whole article

Preview image blogpost

Building a Minimal ASP.NET Core clone

In this article, we will build a minimal version of what ASP.NET Core does - yes, you read right. We will create a very simplistic clone of ASP.NET Core to discuss how the whole thing works. Beginning with a simple console application, we will add the necessary components to make it work as a web server. Bonus points for our own middleware pipeline and dependency injection.

Read the whole article

Preview image blogpost

Create your own Validationattribute in ASP.NET Core

In this small blog post, I will show you how to create your own Validation attribute in ASP.NET Core to tailor-made your validation rules.

Read the whole article

Preview image blogpost

What is a Middleware and how to use it in ASP.NET Core?

Did you ever ask yourself: What is a middleware, and why should I use it?

If so, this blog post is exactly for you. We will see where we could use a middleware and also how we can use the Dependecy Injection container of ASP.NET Core.

Read the whole article

An error has occurred. This application may no longer respond until reloaded. Reload x