Check if DateTime Is Weekend or Weekday
In this article, we are going to find out how to check if a DateTime is a Weekend or a Weekday. Most programming languages work very well with numeric or textual data. But not all of them have the tools for handling information in the form of dates and times. Luckily...
Generate Random Double Numbers in a Range in C#
In this article, we are going to learn how to generate random double numbers in a range in C#. Generate a Pseudorandom Double To generate a pseudorandom double...
Code Maze Weekly #108
Issue #108 of the Code Maze weekly. Happy New Year! Check out what's new this week and enjoy the read. .NET and C# Building ASP.NET Core and EF Core multi-tenant apps – Part1 [www.thereformedprogrammer.net] Awesome series to start the New Year with. Multi-tenant...
Records in C#
In this article, we are going to discuss a new feature added in C#9, called "records". Records offer an alternative to classes and structs and offer a number of advantages over those types that we'll cover in this article. Jonathan Danylko gives us a run-through of the most important C# features with some nice refactoring examples. Integration...
How to Generate Random Numbers From a Range in C#
In this article, we are going to be learning how to Generate Random Numbers in C#. So, let's start. Generate Random Numbers There are two main classes that...
Using Authorization with Swagger in ASP.NET Core
In this article, we are going to look at how to implement swagger authorization in an ASP.Net Core Web API application. We are only going to cover how to set up swagger to accept JSON Web Token (JWT) and how to utilize the token generated to access restricted...
How to Convert Char Array to String in C#
In this article, we’re going to talk about the char type, and explore options to convert char array to string in C#. The char type keyword is an alias for the .NET System.Char structure type that represents a Unicode UTF-16 character. .NET System.Char array stores...
Using Autofac in a .NET (Core) Project
In this article, we're going to learn about using Autofac in .NET projects. Autofac is a powerful third-party Dependency Injection (DI) container. Dependency Injection is one of the most important concepts in modern software development since it helps us build loosely...
Code Maze Weekly #106
Issue #106 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# How to Upgrade a Codebase from .NET Framework to .NET 6 [christianfindlay.com] Upgrading a legacy codebase is a common thing, and in some cases, it can be quite painful....
How to Get an Item by Index From Dictionary in C#
In this article, we’re going to explore accessing Dictionary items by index in C# and its performance considerations. The Dictionary<TKey,TValue> generic class provides the ability to map keys to values. Retrieving a value by using its key is quite fast, almost...