Category Archives: C#

04 Feb

Exploring C# 12 Features

As technology evolves, programming languages continue to advance, offering developers new tools and features to enhance their productivity and simplify complex tasks. In the world of .NET development, C# remains a prominent language, constantly evolving to meet the needs of modern software development. C# 12, the latest iteration of this language, introduces several compelling features […]

read more »
04 Feb

Dependency Injection in .NET 8.0 – Keyed Service Registration

Dependency Injection (DI) in .NET provides a mechanism for managing the dependencies between various components within an application. When registering services, it allows specification of service lifetimes, service types, and their corresponding implementations. The service lifetime defines how instances of the service are managed by the DI container, including options such as Transient (created each […]

read more »
04 Feb

Exploring Channels in .NET

Channels in .NET are a fundamental addition to the asynchronous programming model. They provide a way to pass data between producers and consumers in a thread-safe manner, enhancing performance and scalability in applications. Channels are based on the System.Threading.Channels namespace and offer a flexible and efficient means of communication. Creating a Channel Let’s begin by […]

read more »
C# 7.0 – Tuples
11 Apr

C# 7.0 – Tuples

Tuples are not completely new in C# 7.0. In .NET Framework 4.0, a set of Tuple classes has been introduced in the System.Tuple namespace. If you want to return more than one value from a method then you need to use Tuples. Besides, in the programming world, it is a very common thing to return multiple values from a method. Tuples in C# 7.0 provides a better mechanism to return multiple values from a method.

read more »
C# 7.0 -Ref Return and Ref Local
11 Apr

C# 7.0 -Ref Return and Ref Local

C# 7.0 introduces ref returns and ref locals. The main goal of these new features is to make it easier for developers to pass around references to value types instead of copies of their values. This is important when working with large data structures that are implemented as value types. C# allows passing parameters by reference, but a method was not able to return a reference. This has been changed with C# version 7.0.

read more »
C# 9 top 3 features
10 Apr

C# 9 top 3 features

Today we are going to discuss three features from C# 9.0. In order to use C# 9.0 and .NET 5.0, we should have Visual Studio 16.8 or above. As you might have already know .NET is the next version from .NET Core 3.1. The reason .NET 5.0 was chosen so that there is no confusion with the .NET version 4.* and Microsoft wanted to get rid of the Core because going forward this is the .NET version. Though for ASP.NET it is going to be still named as ASP.NET Core 5 because there is already AP.NET MVC 5.0. Here to avoid confusion, Core is retained. Same is applicable for Entity Framework Core. Entity Framework 5.0 will be named as Entity Framework Core 5 because there is already EF 5.0 and EF 6.0. Let us dive into features.

read more »