Code Maze Author

Code Maze

This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.
Also find me here:



MY ARTICLES:

How to Compare Two Files in C#

In this article, we will learn how to compare two files in C#. There are several reasons why we might want to compare two files in our code, such as integrity checks, detecting duplicate files, version control, synchronization, and more. But what are the different...

Introduction to Brighter in .NET

Brighter is a feature-rich .NET library for dispatching and processing commands that make it easy to implement in-process and out-of-process processing; moreover, it makes it easy to implement CQRS architecture. In this article, we will learn how to use Brighter in...

How to Fix CORS Error With AnyOrigin and AllowCredentials

In this article, we will learn how to fix the CORS protocol error with AnyOrigin and AllowCredentials in ASP.NET Core (The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time). We assume you know the basics of CORS and how...

Single and Split Queries in Entity Framework Core

Entity Framework Core (EF Core) offers developers two powerful querying strategies: Single and Split Queries. In this article, we'll delve into the pros and cons of each, helping us make informed decisions for efficient data retrieval. The sample in our repository...

How to Check if a Number Is Positive or Negative in C#

In programming, it is very crucial to figure out whether a number is positive or negative. This article will walk through different ways to do that in C#. We will discuss in detail some of the very common ways to evaluate if a number is positive or negative,...

How to Check if a String Contains Only Letters in C#

In this article, we'll explore different alternatives to check if a string contains only letters in C#. We will learn the characteristics of each approach, discuss the benefits of each one, and choose the one that best fits each situation. [sc name="github"...

Different Ways to Validate an Uploaded File in ASP.Net Core

As developers, we often tend to oversee the security of our applications. Whether the user misclicks on the wrong file or purposely uploads a malicious one, we should always validate the input loaded through our application. In this article, we'll look at a few...

Tools and Best Practices for Secret Management in .NET

In this article, we will talk about the tools and best practices for secret management in .NET applications. Every application has values it wishes to keep hidden. One of the critical aspects of security in software development is how we handle secrets. Examples of...

How to Correctly Implement IDisposable Interface in C#

In this article, we will show how to correctly implement the IDisposable interface. We will focus on key aspects with a clear explanation. The IDisposable interface in managed code gives us a tool to manage resource cleanup. By implementing IDisposable, we can also...

Different Ways to Run Background Tasks in ASP.NET Core

In this article, we'll explore different ways of running background tasks in ASP.NET Core applications without depending on external providers. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/aspnetcore-features/RunningBackgroundTasks"...

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 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#

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

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...