| | |

.NET Performance: ToList vs ToArray

.NET 9 brings significant improvements to LINQ’s ToArray method, both in terms of speed, as well as memory allocation. To achieve this, the new implementation makes use of new runtime features such as InlineArray and ArrayPool to significantly reduce memory allocations and improve speed, especially when dealing with an IEnumerable<T> of unknown length. If you’re curious about…

An example of using C# 13 params with a ReadOnlySpan.
| | |

C# 13: Use params collections with any recognized collection type

The params modifier in C# has traditionally been associated with array types, allowing methods to accept a variable number of arguments. However, starting with C# 13, you can now use params collections with a variety of collection types, broadening its applicability and making your code even more versatile. Supported collection types The params modifier now…

| | |

How to switch to C# 13

While trying out C# 13 features, it’s possible you might come across errors similar to these: Feature is not available in C# 12.0. Please use language version 13.0 or later. or Error CS8652: The feature ‘<feature name>’ is currently in Preview and unsupported. To use Preview features, use the ‘preview’ language version. There are two…

|

C# language version history

C# 1.0 Introduced with .NET Framework 1.0 in January 2022, C# 1.0 established the foundation of the language with basic object-oriented programming features, including classes, structs, interfaces, events, properties, and delegates. The language had the following goals: C# 2.0 Introcudec in 2005, this version brought significant enhancements such as generics for type-safe data structures, anonymous…

Performance comparison of read operations between Dictionary and FrozenDictionary
|

.NET 8 performance: Dictionary vs. FrozenDictionary

With .NET 8 we are introduced to a new dictionary type which improves the performance of read operations. The catch: you are not allowed to make any changes to the keys and values once the collection is created. This type is particularly useful for collections that are populated on first use and then persisted for…

|

How to install .NET Aspire

.NET Aspire is a comprehensive, cloud-oriented framework designed for creating scalable, observable, and production-grade distributed applications. In this article we’ll look at the prerequisites of getting started with .NET Aspire. If you want an overview of .NET Aspire and what it brings to the table, check out our What is .NET Aspire article. There are…

|

What is .NET Aspire?

.NET Aspire is a comprehensive, cloud-oriented framework designed for creating scalable, observable, and production-grade distributed applications. It was introduced in preview part of the .NET 8 release. The framework is provided through a set of NuGet packages, each addressing different aspects of cloud-native application development, which are typically structured as a network of microservices rather…