How to Detect if a Key is Pressed in a C# Console Application
We frequently read data from user input in our C# application. However, we sometimes need to detect a key press and continue the operation. In this article, we discuss how to detect if a key is pressed in a C# console application. By understanding the usage of these...
Improvements in the Using Directive for Additional Types in C#
The "using" directive in C# helps us reduce boilerplate code when referencing types and members that sit outside the context of our class. C# 12 further expanded on the using directive, allowing it to be used for additional types. In this article, we'll start by...
Code Maze Weekly #209
Issue #209 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks 6 Types of Constructors in C# [codingsonata.com] Let's go over the basics and see which constructors we have available in C# with Aram Tchekrekjian. Can you...
How to Test gRPC Services in ASP.NET Core
gRPC is a popular way to create fast and scalable API's in the .NET world. In this article, we explore how to test gRPC Services in .NET applications, and set up both unit and integration tests to ensure the reliability and performance of gRPC services. Here's something a bit different but important if you're into web development....
Present a List of Files in a Directory With Directory Browsing in ASP.NET Core
In ASP.NET Core, directory browsing is a feature that allows a web application to present a list of files in a specified directory to the user. For security, however, directory browsing is disabled by default to prevent unauthorized users from accessing a website's...
Improve Performance With Source-Generated RegEx in .NET
In this article, we'll look at source-generated RegEx and how it can improve performance in our .NET applications. ...
Scale Your Services With Service-Oriented Architecture in .NET
In this article, we will discuss the Service-Oriented Architecture in .NET. We will cover what it is, how to implement it, how it differs from Microservice Architecture, and how we can use cloud computing platforms as a jump pad to quickly stand up services and...
How to Validate a GUID in C#
In this article, we will explore several approaches to validate a string representation of a GUID in C#. So let's dive in. What Does...
Generate Sortable Unique IDs With the NewId Library in .NET
In this article, we'll explore why we might need sortable unique IDs in .NET and how to create them with the NewId NuGet Package. ...
Different Ways to Create a Generic List of Anonymous Types in C#
Knowing how to manipulate complex datatypes such as Lists is crucial when storing and manipulating data in C#. Sometimes, we may want to incorporate versatility by not having to define explicit classes and create generic lists of anonymous types in C#. In this...
The Fastest Way to Remove the Last Character of a String
Creating and manipulating string objects can be useful when building applications. In the C# programming language, string objects contain text values stored as a sequential read-only collection of character objects. This means string objects are immutable and thus...
Code Maze Weekly #207
Issue #207 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks C# 12: Alias Any Type [www.thomasclaudiushuber.com] Aliasing types and namespaces has been around for the longest time. With C# that feature has been extended...
Fastest Way to Check if a List is in Order in C#
In this article, we'll examine different techniques to check whether or not a list is in order in C#. We'll begin by examining several techniques, including parallel processing. Finally, we'll run a series of benchmarks to help us choose which option fits best in our...
How to Get the HTML Content of a Web Page as a String in .NET
In this article, we will look into a comprehensive guide on how to get the HTML content of a web page as a string and how to parse the content retrieved. First things first, we'll learn how to retrieve HTML content as a string from the web using tools like HttpClient,...