Parsing HTML With AngleSharp in C#
In this article, we will be exploring parsing HTML with AngleSharp in C#. AngleSharp is a powerful library in C# that gives us the ability to parse angle bracket-based hyper-texts like HTML, SVG, MathML, as well as XML. Our focus in this article will be to introduce...
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. A simple middleware that logs your request headers can go a long...
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. ...