C# Sort Dictionary by Value (Including Object Type Values)

Dictionary in C# is a set of keys and values. Sorting dictionary by value can be confusing since there is no straight method provided for the same in either System.Linq or System.Collections.Generic namespace. Let us discuss different ways to sort dictionary by value. Let us consider below Dictionary Using Linq – Method Syntax Using Linq …

C# Sort Dictionary by Value (Including Object Type Values) Read More »

Constructor Chaining in C#

Ever wondered whether you can inherit constructors? Well, here’s all you need to know about it. Is Constructor Inheritance possible? Why or why not? Constructors cannot be inherited in C# mainly because if that happens, we won’t be able to correctly determine how the objects of our derived classes are instantiated. Another problem that could …

Constructor Chaining in C# Read More »

How to Implement IDisposable Interface in C#

In this article we will understand the IDisposable interface of the Microsoft System library. Below are the points that we will look upon: Why is IDisposable interface required Unmanaged memory The .NET Garbage Collector Disposable interface in detail The Using block along with Dispose System Libraries that use IDisposable interface Conclusion Why is the IDisposable …

How to Implement IDisposable Interface in C# Read More »

C# LINQ Distinct or Group By. Get Distinct values from Collection of Objects

Microsoft has provided the LINQ Methods under the System.LINQ namespace. It is a very powerful tool to work upon collections/Lists. Let us quickly understand the syntax and concepts for implementing the Distinct method of LINQ under different circumstances. Below is the list of different ways that we will discuss to fetch Distinct Objects. Using Distinct …

C# LINQ Distinct or Group By. Get Distinct values from Collection of Objects Read More »