Latest Posts On Code Maze

Object Initializers in C#

Object Initializers in C#

In this article, we are going to learn about object initializers in C#, which is a feature introduced in version 3.0 that simplifies code by eliminating the need to write multiple lines of code to initialize an object and its properties. The newest feature of the Microsoft.Extensions.Hosting...

Structured Logging in ASP.NET Core With log4net

Structured Logging in ASP.NET Core With log4net

Log4net is a very popular open-source logging library for .NET applications. This library is part of the Apache Logging Services project at the Apache Software Foundation. Log4net provides a flexible way of writing logs to different output targets like files,...

How to Reverse a String in C#

How to Reverse a String in C#

Reversing a string is a common task in programming, and C# provides several ways to accomplish it. Whether we need to reverse a string for sorting purposes, to improve search efficiency, or for any other reason, understanding how to perform this operation in C# is an...

Compare DateTime in C#

Compare DateTime in C#

In C#, several methods and operators are available to compare DateTime. In this article, we will learn about them along with the best practices.

To download the source code for this article, you can visit our GitHub repository.
How much should we use DbContext or IQueryable throughout...

Init Only Setters in C#

Init Only Setters in C#

In this article, we'll dive into one of the cool new features of C# 9.0: the Init keyword. First, we'll take a closer look at what this feature is. Then, we'll explore how the Init keyword works and how we can incorporate it into our projects. Sometimes getting a piece of information from a...

ArrayList and List Comparasion in C#

ArrayList and List Comparasion in C#

While building an application, we often encounter situations to store or retrieve objects and .NET gives plenty of storage options to do that. These options are categorized into generic and non-generic collection types. In this article, we are going to see two such...

How to Identify If a String is a Number in C#

How to Identify If a String is a Number in C#

In this article, we are going to learn some different ways to identify if a string is a number in C# and compare them with a benchmark to determine the fastest and the slowest approach. or MemoryStream can be problematic and discuss the benefits of using streams instead. By leveraging streams, we can significantly...

Using sizeof() Operator in C#

Using sizeof() Operator in C#

If we are looking for a way to get the size of a data type in C#, mastering the sizeof() operator is just what we need. This operator returns the accurate memory size that any data type occupies. In this article, we will dive into understanding how to use this...

Code Maze Weekly #170

Code Maze Weekly #170

Issue #170 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks 13 Libraries in ASP.NET Core Every Developer Should Know About [codingsonata.com] Some of the extremely helpful libraries we...