Latest Posts On Code Maze

How to Generate a Random Color Name in C#

How to Generate a Random Color Name in C#

In this article, we will learn how to generate a random color name using the KnownColor enumeration. This enum is particularly useful in UI design and data visualization, as it provides a wide variety of preset colors. [sc name="github"...

HttpClient Default Timeout in C# and How to Change It

HttpClient Default Timeout in C# and How to Change It

An HttpClient waits 100 seconds for a response before it gives up. That is the default value of its Timeout property, and it applies to every request the instance sends. When it elapses, the call throws an OperationCanceledException instead of returning a failed...

Result Pattern in C# and .NET Web API

Result Pattern in C# and .NET Web API

The Result Pattern is a way of returning a response containing the operation's outcome and any data it returned. With it, a method can report a failure without returning null or throwing an exception. In the expanding world of APIs, meaningful error responses can be...

How to Find the Latitude and Longitude of a Location in C#

How to Find the Latitude and Longitude of a Location in C#

In this article, we will learn how to find the latitude and longitude of a location in C# using the Google Maps Geocoding API. We'll introduce two different methods for obtaining the coordinates: using the GoogleMaps.LocationServices NuGet package, which simplifies...

C# QR Code Generator: How to Use QRCoder in .NET

C# QR Code Generator: How to Use QRCoder in .NET

QRCoder generates QR codes in C# from a single NuGet package with no third-party dependencies. A QRCodeGenerator encodes our text into a QRCodeData grid, and a renderer turns that grid into a PNG, an SVG, or one of several other formats. [sc name="github"...

How to Update an Item in a List in C#

How to Update an Item in a List in C#

In this article, we'll look at how to update an item in a List in C#, using a simple library management system as an example. We'll explore the intricacies of this common operation and learn how to manipulate lists in our C# applications effectively. [sc name="github"...

Differences Between .NET and C#

Differences Between .NET and C#

When diving into the programming world, distinguishing between .NET and C# can be puzzling. .NET is a framework, that provides a platform for building applications. In contrast, C# is a programming language used within this framework. Despite their close association,...

YamlDotNet: Read and Write YAML in C#

YamlDotNet: Read and Write YAML in C#

YamlDotNet is the library .NET uses to read and write YAML, because the framework ships no YAML support of its own. Two builders do almost all the work: SerializerBuilder turns an object into a YAML string, and DeserializerBuilder turns a YAML string back into an...

SkiaSharp in C#: How to Generate Images

SkiaSharp in C#: How to Generate Images

SkiaSharp draws images in .NET with three types. An SKBitmap is the pixel buffer, an SKCanvas is the drawing surface bound to it, and an SKPaint carries the color and style for each drawing call. [sc name="github"...

Using Kafka in an ASP.NET Core Web API

Using Kafka in an ASP.NET Core Web API

At its core, Kafka is a distributed streaming platform designed to handle large volumes of data in real-time. Its exceptional performance, fault tolerance, and scalability make it a pivotal component in event-driven architectures. [sc name="github"...

How to Create a Zip File in Memory In C#

How to Create a Zip File in Memory In C#

In this article, we will look at how we create In-Memory Zip files in C#. Previously, we discussed how to create and read Zip files in .NET in our Working With Zip Files in C#/.NET article, so we recommend taking a look at that to familiarize yourself with working...

How to Show the Generated SQL Query in EF Core

How to Show the Generated SQL Query in EF Core

Entity Framework Core has many useful features, and in this article, we will see how to use it to show a generated SQL query. EF Core is an open source Object-relational mapper that supports several databases like SQLite, PostgreSQL, MySQL, and also LINQ (Language...

How to Build a URL Shortener in .NET Applications

How to Build a URL Shortener in .NET Applications

When working with URLs in our applications, there are times when they may become too long, clunky, unreadable, and difficult to use. In such situations, we can employ a URL shortener to make them shorter, more readable, and easier to share. Essentially, a URL...