LINQ / C#

LINQ Intersect Operator

LINQ Intersect operator is used to find common elements between two sequences (collections). Intersect opertor comes under Set operators category in LINQ Query operators. For example, we have two collections A = { 1, 2, 3 } and B = { 3, 4, 5 }. Intersect operator will find common elements …

LINQ Intersect Operator Read More
LINQ / C#

LINQ Distinct Operator

LINQ Distinct operator is used for removing duplicates elements from the sequence (list). Distinct operator comes under Set operators category in LINQ query operators. For example, we have one collection A = { 1, 2, 3, 3, 4, 4, 5}. In this collection 3 and 4 elements are repeated two …

LINQ Distinct Operator Read More
LINQ / C#

LINQ All Operator

LINQ All operator is used to check whether all elements in a sequence (collection) satisfy a particular condition or not. LINQ All operator comes under Quantifier Operators category in LINQ Query Operators. Lets take an example, we have a collection A = { 3, 6, 9, 12 } and we …

LINQ All Operator Read More
LINQ / C#

LINQ Any Operator

LINQ Any operator comes under the Quantifier Operators category in LINQ Query operators. LINQ: Any operator is used for two cases: Any operator is only available in Method syntax and not in Query Syntax. Below is the syntax of Any operator public static bool Any(this IEnumerable source);public static bool Any(this IEnumerable source, Func …

LINQ Any Operator Read More
LINQ / C#

LINQ Contains Operators

LINQ Contains operator is used to check whether an element is available in sequence (collection) or not. Contains operator comes under Quantifier Operators category in LINQ Query Operators. Below is the syntax of Contains operator. First overload takes a single parameter. Second overload function is used when we have to …

LINQ Contains Operators Read More
C# / LINQ

LINQ SelectMany Operator

SelectMany operator is used when we have a sequence of objects which has a collection property and we need to enumerate each item of child collection one by one. SelectMany operator comes under Projection operators category of LINQ Query Operators. Below is the syntax of SelectMany operator There are three main overloads …

LINQ SelectMany Operator Read More

NUnit TestFixture C# Tutorial

NUnit TestFixture attribute is a class level attribute and it indicates that this class contains NUnit Test Methods. Below are the topics we covered in this tutorial: NUnit TestFixture Example and Usage Below is the example usage of TestFixture NUnit attribute. Remember: TestFixture can only be placed on class not on …

NUnit TestFixture C# Tutorial Read More