Latest Posts On Code Maze

Code Maze Weekly #172

Code Maze Weekly #172

Issue #172 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Avoid Proliferating DbContext or IQueryable in .NET Apps [ardalis.com] 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...

Fast Inserts With Entity Framework (EF Core)

Fast Inserts With Entity Framework (EF Core)

In this article, we will review multiple ways of performing fast inserts of bulk data into a database using the Entity Framework (EF for short). Entity Framework "classic" was introduced in 2008, was superseded nearly a decade later by EF Core, and continues to add...

Easy Sorting, Filtering and Pagination in .NET With Sieve Package

Easy Sorting, Filtering and Pagination in .NET With Sieve Package

Most applications that are developed nowadays usually involve interacting with non-trivial amounts of data, so we need to provide functionality for sorting and filtering in our applications. Moreover, speed and load times are increasingly important, so we don't want...

How to Return XML From ASP.NET Core Web API

How to Return XML From ASP.NET Core Web API

ASP.NET Core is a powerful and flexible platform for building web applications. It supports multiple data formats, including JSON and XML, and provides many tools for serialization and deserialization. In this article, we will focus on how to return XML from ASP.NET...

Short Circuit Evaluation of IF Statements with Await in C#

Short Circuit Evaluation of IF Statements with Await in C#

In this article, we are going to look at what exactly short circuit evaluation is in C# and how asynchronous calls are affecting it. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/async-csharp/ShortCircuitEvaluationWithAsyncAwait"...

How to Serialize Exceptions as JSON in .NET

How to Serialize Exceptions as JSON in .NET

In this article, we will learn how to serialize exceptions as JSON in .NET. Good exception handling is one of the key aspects of a successful enterprise application. And when we talk about an API, it's important that we provide relevant failure details to consumer...