Latest Posts On Code Maze

Required Parameters in Blazor WebAssembly

Required Parameters in Blazor WebAssembly

When we want to pass data in Blazor from a parent component to a child component, we use parameters. Parameters are defined on the component class with the Parameter attribute. If we define the parameter in the child component but don't pass a parameter from the...

EntityFramework Core vs Dapper

EntityFramework Core vs Dapper

In this article, we will discuss the differences between EntityFramework Core and Dapper. EntityFramework Core and Dapper are .NET...

StyleCop Analyzers Implementation in .NET

StyleCop Analyzers Implementation in .NET

As developers, we often have different ideas for writing our code. While coding style preferences can differ, being consistent is important. In this article, we will explore the benefits of StyleCop Analyzers and how they can help us enforce a unified coding style...

Compare Byte Arrays in .NET

Compare Byte Arrays in .NET

In .NET, byte arrays are a common data type used to represent a sequence of bytes. They often represent binary data such as images, audio files, or serialized objects. Comparing byte arrays in .NET requires a good understanding of how the .NET framework handles arrays...

How to Integrate BenchmarkDotNet With Unit Tests

How to Integrate BenchmarkDotNet With Unit Tests

In this article, we will learn how to integrate BenchmarkDotNet with Unit Tests and use some advanced APIs of the BenchmarkDotNet library when doing that. In the .NET ecosystem, BenchmarkDotNet is the go-to library for conducting performance benchmarks. Typically we...

Firebase Authentication in .NET

Firebase Authentication in .NET

Authentication is inherently a complex topic to understand and implement in our applications. So, generally, we avoid writing the logic from scratch and opt for an off-the-shelf solution. Firebase, the cloud solution from Google, provides an authentication service...

Discriminated Unions in C#

Discriminated Unions in C#

In this article, we will look at the usage of discriminated unions in C#, specifically with the open-source library OneOf. We'll go into some practical examples and why this pattern is becoming increasingly popular in .NET applications today. First, let's talk about...

Converting a Byte Array to Hexadecimal String in C#

Converting a Byte Array to Hexadecimal String in C#

In this article, we will look at converting a byte array to a hexadecimal string. Converting between byte arrays and hexadecimal strings is a common occurrence in computer programming. Hexadecimal strings have the advantage of being both human-readable and easy to...

Roslyn Compiler and Analyzers in .NET – Introduction

Roslyn Compiler and Analyzers in .NET – Introduction

In this article, we will introduce Roslyn compiler and analyzers in .NET. Moreover, we will delve into utilizing Roslyn to compile C# code and explore various types of Roslyn analyzers. Roslyn is an open-source compiler for C# and Visual Basic. Roslyn exposes a wide...

Easy Web Application Caching With Redis in C#

Easy Web Application Caching With Redis in C#

Started to improve the scalability of an Italian startup, Redis has emerged as a powerful solution for efficient and fast data storage and retrieval. With Redis, applications can achieve lightning-fast access to frequently used data enabling millions of requests per...

Hashtable in C#

Hashtable in C#

In this article, we will explore the Hashtable class in C#. We will comprehensively discuss its practical usage and key features. Let's dive...

How To Parse String to DateTime in C#

How To Parse String to DateTime in C#

In this article, we will discuss how to parse string representations of date and time to an equivalent DateTime value in C#. The available methods in the DateTime class include Parse(),  TryParse(), ParseExact()and TryParseExact(). These methods can parse a string to...

Test Data Generation With AutoFixture in .NET

Test Data Generation With AutoFixture in .NET

In this article, we will explore how to automate test data generation, enhance productivity, improve test coverage, and reduce maintenance efforts with a single library called AutoFixture. [sc name="github"...

Log4net Appenders Introduction With C# Examples

Log4net Appenders Introduction With C# Examples

Log4net appenders are the components that determine where we need to keep the logs. Using appenders, we can send log4net logs to different destinations such as the console, files, databases, etc. In this article, we are going to discuss a few of the most common and...

DateTime Calendars in C#

DateTime Calendars in C#

When working with dates, we must consider the fact that there are many different calendar systems worldwide. The default calendar used in C# DateTime operations is the Gregorian calendar, since it's the most popular system. However, there are situations where we may...

ArrayList in C#

ArrayList in C#

In this article, we are going to learn about ArrayList. It is one of the collection types in C# that allows us a flexible option to store data. ...

Value Objects in C#

Value Objects in C#

In this article, we are going to dive into a very interesting concept in domain-driven design: value objects. We will take a look at many aspects of value objects, what makes them useful, and discuss situations where they may not be appropriate. [sc name="github"...

Execute a PowerShell Script in C#

Execute a PowerShell Script in C#

In this article, we’ll learn how to execute a PowerShell script in C# using the ProcessStartInfo class from System.Diagnostics namespace and PowerShell classes from the System.Management.Automation namespace, which is available in PowerShell.SDK. [sc name="github"...

Permutations of a String in C#

Permutations of a String in C#

In this article, we will learn how to create permutations of a string in C#. By permutating characters, we can generate different words from the same characters. [sc name="github"...

How to Use Bulk Updates in Entity Framework Core

How to Use Bulk Updates in Entity Framework Core

In this article, we are going to talk about how to use bulk updates in Entity Framework Core. If you are interested in a deeper dive into how to use Entity Framework Core, we have a whole series about that. [sc name="github"...