Code Maze Weekly #162
Issue #162 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Using Hangfire with ASP.NET Core [damienbod.com] Hangfire is a very popular open-source library for performing background...
Different Types of Comments in C# and Should We Use Them
In this article, we are going to talk about different types of comments in C#. The compiler will compile any syntactically correct code into an intermediate language, and after that, the .NET runtime will execute this IL code on the client computer. The computer will...
How to Pass Arguments for Output Parameters in Stored Procedures With Dapper in C#
In this article, we are going to learn about passing output parameters to stored procedures with Dapper. Stored procedures are a great way to improve the performance, security, and usability of our code. They bring many advantages over relying on our application code...
Resolving the Call Is Ambiguous Error While Using LINQ
In this article, we will learn when the "call is ambiguous" error happens, why the error happens, and how to work around the issue. There are still so many legacy projects using older versions of EF Core, and in those projects, this error can cause a lot of headaches...
Create Clean Guard Clauses With GuardClauses in C#
In this article, we discuss how to create guard clauses, how they differ from user input validation, and how to improve our guards by writing clean guard clauses leveraging the GuardClauses library. Sometimes passwords can end up being exposed even if...
How to Modify a Base URI of Swagger in ASP.NET Core
In this article, we’re going to learn how to change Swagger base uri in ASP.NET Core Web API. So let's start. Swagger and Base Uri Swagger is an...
Determine Whether Two Date Ranges Overlap in C#
In this article, we will discuss how to determine whether two date ranges overlap in C#. We will explore how to achieve this result using the DateOnly and TimeOnly records and then, we're going to beautify our implementation with a custom class representing date...
Multipart Form-Data in HttpClient with ASP.NET Core
In this article, we will learn what multipart requests are and how we can use them. Also, we will review examples of how to send data to remote servers using multipart form-data with HttpClient in ASP.NET Core.
.NET Dependency Injection With Constructor Parameters
Introduction In this article, we'll look at ways to use dependency injection with constructor parameters in .NET Core. Dependency injection (DI) with constructor parameters is a way for us to pass the things our class needs (depends on) when we create a new instance...
How to Return a Default Value From a Dictionary in C#
In this article, we are going to present you solutions on how to return a default value from a Dictionary in C# and run an evaluation test against these methods to find the most efficient. [sc name="github"...
Asynchronous Programming Patterns in .NET
In this article, we are going to learn about the various patterns to implement asynchronous programming in .NET. .NET has had in-built support for asynchronous programming since the release of .NET Framework 1.1. It has been through various improvements over the...
How to Clone a List in C#?
In this article, we will look at all the different ways we can clone a List in C# to another and what we should pay attention to when doing so. In...
How to Insert a Key Value Pair Into an Existing JSON in C#
In this article, we are going to learn how to insert a key-value pair into an existing JSON object. Let’s start. Use Json.NET to...
Refactoring Bloated Code in C#
In this article, we will learn what anti-patterns belong to the group of code smells called bloaters and different techniques for refactoring bloated code in C#. [sc name="github"...