Category: C#

How to check if the number is positive or negative in C# ?

You can use the > and < operator to check if the number is a positive or negative number in C#. How to check if the number is positive or negative in C# ? If the number is less than zero , it can be considered as negative number. If the number is greater than zero , it is a positive number. Below is a…

C# Compiler Error – CS1673 anonymous methods, lambda expressions, q

In this blog post, you’ll learn more about the C# Compiler Error – CS1673 and the related message description C# Compiler Error Code CS1673 C# Compiler Description for the Code :CS1673 Anonymous methods, lambda expressions, query expressions, and local functions inside structs cannot access instance members of ‘this’. Consider copying ‘this’ to a local variable outside the anonymous method, lambda expression, query expression, or local…

C# Compiler Error – CS1995 the ‘await’ operator may only be used in

In this blog post, you’ll learn more about the C# Compiler Error – CS1995 and the related message description C# Compiler Error Code CS1995 C# Compiler Description for the Code :CS1995 The ‘await’ operator may only be used in a query expression within the first collection expression of the initial ‘from’ clause or within the collection expression of a ‘join’ clause

C# Compiler Error – CS0409 a constraint clause has already been spe

In this blog post, you’ll learn more about the C# Compiler Error – CS0409 and the related message description C# Compiler Error Code CS0409 C# Compiler Description for the Code :CS0409 A constraint clause has already been specified for type parameter ‘{0}’. All of the constraints for a type parameter must be specified in a single where clause.

C# Compiler Error – CS8138 cannot reference ‘system.runtime.compile

In this blog post, you’ll learn more about the C# Compiler Error – CS8138 and the related message description C# Compiler Error Code CS8138 C# Compiler Description for the Code :CS8138 Cannot reference ‘System.Runtime.CompilerServices.TupleElementNamesAttribute’ explicitly. Use the tuple syntax to define tuple names.

How to Remove Duplicates in List using LINQ?

There are times when you have to remove duplicate entried from a List from Your C# program and one of the easiest way to do that is using the combination of the LINQ and IEqualityComparer interface. Assume that you have a list of Actors as shown below ID : 1 , Name = Vijay ,Language = TamilID : 2 , Name = Rajni ,Language =…