Comparing for and foreach Loops in C#
In this article, we will compare the for and foreach loops. Iterating through arrays and lists is fundamental when learning any programming language. C# offers different ways to achieve this, such as using while, for, and foreach statements. But, what about the...
How to Get appsettings.json Content as a Dictionary in ASP.NET Core
When working with ASP.NET Core applications, storing configuration settings in the appsettings.json file is common. While the appsettings.json file offers a convenient way to structure configuration data; there is a common need to retrieve this data in a format that...
How to Pass Complex Parameters to Theory in xUnit
In this article, we are going to explore different ways to pass complex parameters to Theory test methods in xUnit. Let's start...
MapControllers vs MapControllerRoute Routing in ASP.NET Core
In this article, we will examine the two key routing methods in ASP.NET Core: MapControllers vs MapControllerRoute, and their differences. They are vital in directing HTTP requests to the appropriate controller actions. [sc name="github"...
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...
Lazy Loading and Eager Loading in Entity Framework Core
In this article, we will learn about the loading strategies we can employ in EF Core. These strategies, namely Lazy Loading and Eager Loading control how data is fetched from the database. We will also delve into performance impacts and considerations for choosing one...
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...
How to Divide Data Into Batches With LINQ
In software development, it is often necessary to divide data into manageable batches for more efficient processing and improved application performance. In this article, we will look at some approaches to dividing data into batches using LINQ methods, with the C#...
Probabilistic Programming in C# With Infer.NET
With the increasing progress and interest in AI and Machine Learning, keeping track of and understanding the technologies behind powerful AI and ML systems is essential. One of these technologies is Probabilistic Programming. In this article, we will learn what it is...
Different Ways to Get the First Record in Each Group With LINQ
In this article, we will explore different methods to get the first record in each group with LINQ. Grouping, searching, sorting, filtering,...
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 Use ArraySegment in C#
In this article, we will show how to use the ArraySegment<T> in C#. Arrays are one of the most fundamental collection...
How to Select Multiple Records Based on a List of IDs Using LINQ
In this article, we are going to explore how to select multiple records based on a list of IDs using LINQ. We will demonstrate two ways to do that, and we will investigate the cases in which each might be a better choice. [sc name="github"...
Monolith and Distributed Monolith Architectural Patterns in C#
In this article, we are going to discuss the monolith and distributed monolith architectural patterns. We'll cover what the patterns are, how to implement them in C#, and why we should use them over some other alternatives such as microservices. Let's start with a...
How to Read XML Documents in C#
In this article, we'll talk about how to read XML Documents in C#. In the preceding article, we addressed the creation of custom XML documents. Also, we have already explored how to serialize and deserialize objects to and from XML in the articles titled Serializing...
How to Create XML Files in C#
In this article, we will explore how to create XML files in C#. Let's dive in. Create Custom XML Files To create custom XML documents in .NET, we use an object...
Differences Between a Virtual and an Abstract Method in C#
In this article, we will learn about the differences between a virtual and an abstract method. Object-oriented programming thrives on inheritance – leveraging common functionalities across classes for efficient and organized code. However, regarding methods, C# offers...
Difference Between Select and SelectMany Methods in LINQ
In this article, we will uncover the Select and SelectMany methods in LINQ: essential tools for efficient data querying and collection management. ...
Fastest Way to Convert a JObject to a Dictionary in C#
In this article, we'll explore different ways to convert a JObject to a dictionary in C#. In C# programming, a JObject is a fundamental component...
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...



