Category: C#

C# Compiler Error – CS4011 ‘await’ requires that the return type ‘{

In this blog post, you’ll learn more about the C# Compiler Error – CS4011 and the related message description C# Compiler Error Code CS4011 C# Compiler Description for the Code :CS4011 ‘await’ requires that the return type ‘{0}’ of ‘{1}.GetAwaiter()’ have suitable ‘IsCompleted’, ‘OnCompleted’, and ‘GetResult’ members, and implement ‘INotifyCompletion’ or ‘ICriticalNotifyCompletion’

C# Compiler Warning – CS8669 the annotation for nullable reference ty

In this blog post, you’ll learn more about the C# Compiler Warning – CS8669 and the related message description C# Compiler Warning Code CS8669 C# Compiler Description for the Code :CS8669 The annotation for nullable reference types should only be used in code within a ‘#nullable’ annotations context. Auto-generated code requires an explicit ‘#nullable’ directive in source.

Difference between Hash table and Dictionary in .NET

Here’s a simple difference between Hashtable and Dictionary in .NET Dictionary Hashtable It is generic in nature It is non generic in nature It is defined in the namespace System.Collections.Generic It is defined in the namespace System.Collections When a request is made to the dictionary and if the key does not exists , you get an exception When a request is made to the Hashtable…

How to update the value in a Dictionary in C# ?

Below is a sample code snippet demonstrating how to update the value that is stored within the dictionary using C#. We access the dictionary with the key as index and set the value. How to update the value in a Dictionary in C# ?

C# Compiler Error – CS0217 in order to be applicable as a short cir

In this blog post, you’ll learn more about the C# Compiler Error – CS0217 and the related message description C# Compiler Error Code CS0217 C# Compiler Description for the Code :CS0217 In order to be applicable as a short circuit operator a user-defined logical operator (‘{0}’) must have the same return type and parameter types