Latest Posts On Code Maze

Code Maze Weekly #200

Code Maze Weekly #200

Issue #200 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Log Request Headers Middleware for ASP.NET Core [ardalis.com] A simple middleware that logs your request headers can go a long...

How to Get a Value of a Property By Using its Name in C#

How to Get a Value of a Property By Using its Name in C#

In programming, there are scenarios where dynamically retrieving the value of a property by its name becomes necessary. This guide delves into the intricacies of how to get the value of a property by using its name in C# using reflection. Assuming we have a...

How to Check if Items of a List Exist in Another List in C#

How to Check if Items of a List Exist in Another List in C#

One of the programming scenarios we can encounter once in a while is checking whether certain items in a list exist in another. This article is going to dive deep into all the techniques to compare lists. We are also going to compare how these techniques perform and...

Using MariaDB With ASP.NET Core Web API

Using MariaDB With ASP.NET Core Web API

In this article, we will discuss how to use a MariaDB database with an ASP.NET Core Web API. First, we will discuss what MariaDB is and how we include it in our application. Then, we will use the Entity Framework Core library to create a mapping between our Web API...

How to Calculate the Number of Days Between Two Dates in C#

How to Calculate the Number of Days Between Two Dates in C#

In this article, we will learn how to calculate the number of days between two dates, a task commonly encountered in various applications. We will achieve this by utilizing the DateTime struct, TimeSpan struct, and DateTimeOffset. [sc name="github"...

How to Truncate a String in .NET

How to Truncate a String in .NET

In the world of software development, we sometimes face requirements to shorten strings within our applications. A common use case is displaying text in user interfaces, such as labels, buttons, or columns in a table. To ensure that the text fits within a limited...

How To Remove HTML Tags From a String in C#

How To Remove HTML Tags From a String in C#

HTML, since its inception, has played a pivotal role in web development, serving as the foundational markup language for creating and structuring web pages. As developers, we engage with web-related data in our programming endeavors, it is a frequent scenario to...

Add Custom Claims to Access Token in Duende

Add Custom Claims to Access Token in Duende

In this article, we will show how to add custom claims to access tokens in the Duende Identity Server. Custom claims allow us to include application-specific information in ID and access tokens. This information encompasses details not covered by the standard claims...