Latest Posts On Code Maze

Differences Between ExpandoObject, DynamicObject and dynamic

Differences Between ExpandoObject, DynamicObject and dynamic

In C#,  the dynamic keyword, the ExpandoObject class, and the DynamicObject class, are the main approaches to working with dynamic objects. However, ExpandoObject and DynamicObject are often used interchangeably, so it can be quite difficult to distinguish them. In...

Working With Guid in C#

Working With Guid in C#

In the world of software development, maintaining data integrity and uniqueness is of utmost importance. One such unique identifier in C# is the Guid (Globally Unique Identifier) class. In this article, we will explore the Guid class in .NET, its features, and how we...

How to Get Class Name as String in C#

How to Get Class Name as String in C#

In our programming journey, there are times when we might find ourselves in a situation where we need to obtain the class name as a string. This proves beneficial for many reasons, such as logging, debugging, or other programming endeavors. In C#, there are different...

How to Add a Global Route Prefix in ASP.NET Core

How to Add a Global Route Prefix in ASP.NET Core

In this article, we will learn how to add a global route prefix in ASP.NET Core. This enables us to effortlessly incorporate the route prefix into our application's routing mechanism, offering greater flexibility and control. [sc name="github"...

How to Read Values From Query Strings In ASP.NET Core

How to Read Values From Query Strings In ASP.NET Core

In this article, we are going to learn how to read values from query strings in ASP.NET Core. In web development, the capability to read and utilize values from the query string holds significant importance. It is crucial to adeptly interpret the parameters...

InProcess and OutOfProcess Hosting Models in ASP.NET Core

InProcess and OutOfProcess Hosting Models in ASP.NET Core

In this article, we will compare InProcess and OutOfProcess hosting models in ASP.NET Core and learn more about each hosting model. Hosting refers to deploying an application into the server for external access. Understanding the hosting process is essential in...

Introduction to Firebase in .NET

Introduction to Firebase in .NET

When designing and building applications, often we find ourselves needing various third-party services, such as databases, push notifications, hosting, authentication, and many other complex features. Firebase, built by Google, is an all-in-one application development...

Virtual Methods in C#

Virtual Methods in C#

In this article, we will discuss virtual methods in C#. We will define what they are and how we implement them. We will also mention virtual methods' uses, benefits, and drawbacks.  [sc name="github"...

Managed vs Unmanaged Code (Garbage Collection) in C#

Managed vs Unmanaged Code (Garbage Collection) in C#

Managed and unmanaged code are two types of code that differ in how they handle memory management. In this article, we'll explore the differences between managed and unmanaged code, focusing on garbage collection. [sc name="github"...

Should We Use Records With EF Core as Model Classes?

Should We Use Records With EF Core as Model Classes?

In this article, we will explore the pros and cons of using records with EF Core as model classes. We'll dive into what C# records are, how they differ from classes, and how they can be used as model classes in EF Core. [sc name="github"...

How To Set Up SSL Certificate In Visual Studio and .NET CLI

How To Set Up SSL Certificate In Visual Studio and .NET CLI

In this article, we'll look at setting up an SSL certificate for use in ASP.NET web applications and creating a new SSL certificate using Visual Studio and the .NET CLI. We'll also look at how to remove SSL certificates using the Windows certificate manager and the...

Expression Trees in C#

Expression Trees in C#

In this article, we will talk about Expression Trees in C#, how to use them, and see some of their applications. We'll also learn about their limitations and performance consideration. Although the topic may initially sound complex, it’s much simpler when we know a...

Refactoring Change Preventers in C#

Refactoring Change Preventers in C#

In this article, we are going to discover which anti-patterns fall into the class of code smells known as change preventers, as well as several approaches for refactoring them in C#. [sc name="github"...

How to Build Dynamic Queries With Expression Trees in C#

How to Build Dynamic Queries With Expression Trees in C#

Applications are becoming more complex and data-driven over time. Indeed, developing the ability to create and modify dynamic queries at runtime is becoming a critical skill for developers. In this article, we'll explore the basics of building dynamic query expression...

How to Send Emails With the SendGrid API in C#

How to Send Emails With the SendGrid API in C#

In this article, we will take a look at how to send emails with the SendGrid API directly from our code. Sending emails from within our applications is a common scenario that we face as developers. Let's look at a couple of use cases where we may need to do this. [sc...

Memory Allocation Optimization With BenchmarkDotNet

Memory Allocation Optimization With BenchmarkDotNet

In this article, we will focus on memory allocation optimization using BenchmarkDotNet. We will also learn how to effectively do that using the MemoryDiagnoser attribute while comparing two of the most popular sorting algorithms - QuickSort and MergeSort. [sc...

Deploy ASP.NET Core Application on Linux with Nginx

Deploy ASP.NET Core Application on Linux with Nginx

In this article, we are going to learn how to deploy an ASP.NET Core web application to the Ubuntu Linux server with Nginx. The introduction of .NET Core opened the cross-platform doors, allowing developers to build and deploy applications on Linux systems. At the...

How to Convert a String to a Span in C#

How to Convert a String to a Span in C#

In modern C# programming, we all strive for efficiency and top-notch performance. And when it comes to dealing with character data, converting a string to a span can be a game-changer. So, in this article, we'll dive into the process of converting a string to a span...