C# 9 introduced us to record and the associated with operator. The with operator helped us to create or clone copies of existing record instances with set of changes specified. In C# 10, the C# team has taken the concepts a little further. Let us first examine what we could do in C# 9. public record Person { public string FirstName … Continue reading Exploring ‘With’ C# 10
Tag: C# 10
.Net 6 : PriorityQueue
.Net 6 is round the corner and in this post, we will continue exploring different features .Net 6/ c# 10 has to offer. For this post, we will focus on the Priority Queue. Fundamentally Queues are data structures that follow the FIFO (or First In First Out). .Net had an implementation of the Queue for … Continue reading .Net 6 : PriorityQueue
.Net 6 : ArgumentNullException.ThrowIfNull
.Net 6 has some nice little hidden features which helps in creating cleaner code, and in this post we will look into one such feature. Previously, if we needed to check if an object is null and raise an exception, we would have done as the following. void Foo(Bar bar) { if (bar is null) … Continue reading .Net 6 : ArgumentNullException.ThrowIfNull