Create a custom proxy endpoint action with ASP.NET Core MVC

Create a custom proxy endpoint action with ASP.NET Core MVC

There are various reasons why it is useful to channel certain requests through your own application to an external endpoint; the most obvious is, for

Load Google Search Crawler IP Address Ranges with Refit

Load Google Search Crawler IP Address Ranges with Refit

Rate Limit is a great tool to protect your own website and content from misuse; in some cases, however, rate limiting is also bad: for example, if yo

Replace and remove whitespaces in strings - performant and sustainable

Replace and remove whitespaces in strings - performant and sustainable

There are many ways to remove spaces or other characters in a string - there are just very big differences in terms of performance and efficiency. Be

Auto Format your Code on save with Visual Studio

Auto Format your Code on save with Visual Studio

Code formatting is a very important element when developers work together on a project - and you are always well advised not to invent your own forma

Sustainable Code with .NET 9

Sustainable Code with .NET 9

Sustainable Code is a constantly growing GitHub repository created by me, in which I collect various everyday code snippets and measure the performan

Use ServiceCollection in Unit Tests with .NET

Use ServiceCollection in Unit Tests with .NET

A popular unit test - and also a necessary test - is the correct registration of interfaces and their implementation with dependency injection. And a

How to process ZIP Files from a Stream in .NET

How to process ZIP Files from a Stream in .NET

When working with ZIP files in .NET, there may be cases where the file is not stored on disk but comes directly as a Stream. This could happen if you

Decompress a ZIP archive with .NET

Decompress a ZIP archive with .NET

Working with compressed files is common in many applications, whether you're extracting data from an archive, installing software packages, or retrie

Compress a folder of files to a ZIP archive with .NET

Compress a folder of files to a ZIP archive with .NET

When working with .NET apps you may sometimes need to bundle multiple files into a single compressed archive for easier storage, transfer, or process

Read cpu load on Windows with .NET

Read cpu load on Windows with .NET

In C# (.NET 6 and above), there is now a very simple way to read out the CPU load with minimal overhead - i.e. without threads. The PerformanceCounte

.NET: the cost of returning an empty collection

.NET: the cost of returning an empty collection

Dealing with empty lists is an everyday situation in .NET. An empty list is often preferred to a null in order to control the logic. But how expensiv

.NET: use a preview version in your global.json

.NET: use a preview version in your global.json

We are currently in the preview phase of .NET 9, which releases in Nov 2024 - and if you want to test it extensively like I do, store the preview ver

Efficiently clean a string with .NET

Efficiently clean a string with .NET

Strings are one of the most commonly used types in .NET applications - and very often the source of inefficient code. For example, cleaning up a stri

Refit .NET - my personal caller best practise

Refit .NET - my personal caller best practise

Refit is an open-source library for .NET developers that simplifies the process of making HTTP API calls. It allows developers to define a set of int

Strong Name Sign .NET Assemblies via SNK

Strong Name Sign .NET Assemblies via SNK

Strong Name Signing is a mechanism in .NET development that ensures the integrity and authenticity of assemblies. It is based on a public-private key

Handle Yaml Files with .NET

Handle Yaml Files with .NET

YAML files are unfortunately part of everyday life for all developers these days; and although they are very error-prone and almost impossible to edi

Welcome to the new Visual Studio SLNX Solution File

Welcome to the new Visual Studio SLNX Solution File

For many years, there has been a lot of criticism of Visual Studio's current solution format. It is very difficult to read, it does not follow any st

Enable NuGet Audit for better DevSecOps in .NET

Enable NuGet Audit for better DevSecOps in .NET

Auditing is becoming increasingly important in the everyday life of a developer; however, until now there was no particularly good way in .NET - even

ASP.NET Core Form protection with Cloudflare's Turnstile

ASP.NET Core Form protection with Cloudflare's Turnstile

TLDR; You can see the full sample in my GitHub repository BEN ABT Samples - ASP.NET Core Form protection with Cloudflare's Turnstile Turnstile is a

Use GitHub Copilot Chat in Visual Studio to solve the .NET Moq drama and migrate to NSubstitute

Use GitHub Copilot Chat in Visual Studio to solve the .NET Moq drama and migrate to NSubstitute

It's now been a few months since the GDPR-drama and data-harvesting around Moq (Stop using Moq as a guinea pig to get feedback on and develop Sponsor

.NET Event Counters

.NET Event Counters

.NET event counters are a relatively new API for collecting metrics from .NET applications. They are part of the EventSource and EventCounter namespa

Top 5 Git Commit Message Best Practises in 2024

Top 5 Git Commit Message Best Practises in 2024

When you join a project as a new developer, you see one thing above all: no standards for Git commit messages. Some put emojis in the message, others

Custom Azure Application Insights Telemetry Metrics with .NET

Custom Azure Application Insights Telemetry Metrics with .NET

By default, Azure Application Insights comes with necessary and important telemetry capabilities to monitor the basic functions of an application and

Azure Communication Service - .NET Client with Managed Identity

Azure Communication Service - .NET Client with Managed Identity

The Azure Communication Service is a fairly new but already popular service for sending emails at scale. In this article, I would like to show you ho

Azure Communication Service - .NET Client with ConnectionString

Azure Communication Service - .NET Client with ConnectionString

The Azure Communication Service is a fairly new but already popular service for sending emails at scale. In this article, I would like to show you ho

Header and Footer Layouts with Handlebars.NET

Header and Footer Layouts with Handlebars.NET

One of the last blog posts (Text and EMail Templates with Handlebars.NET) was generally about HandleBars.NET - a very popular template engine. This p

.NET Naming Best Practises: API Models

.NET Naming Best Practises: API Models

API models are one of the elements where I personally see the most naming errors - which have a massive impact on the architect and cause subsequent

.NET Naming Best Practises: Services vs. Providers

.NET Naming Best Practises: Services vs. Providers

In many code bases there are Services and Providers - and often they do the same thing structurally; but what is the idea of a Service- and Provider-

.NET Naming Best Practises: Database Entities

.NET Naming Best Practises: Database Entities

Database entities are the objects that represent the tables in your database. They are the objects that you use to read and write the database. Namin

.NET Naming Best Practises: DTOs

.NET Naming Best Practises: DTOs

Often seen, often used incorrectly: DTOs. Data Transfer Objects. In principle, DTO is an umbrella term, a design pattern that is used to transfer dat