Imagine you have an s tring("ABCDE99F-J74-12-89A") , and you want to extract the only number from the string. This snippet will show how to extract numbers from strings. using System ; using System . Collections . G…
This article will show you how to generate a moving average of C# collection using LINQ to Objects. LINQ is a very popular feature of C# that allows the developer to write the query like SQL. Let’s consider you have the foll…
Using C# Expression Trees in the Real World In this article, I will discuss ExpressionTree. Expression tree is a compelling feature of the C#. It allows us to Generate code at runtime Rewrite code at runtime Translate code …
As per the Microsoft Language Integrated Query is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages, originally released as a major part of .NET Framework 3.5 in 2007. LINQ pr…
I’ll show you how to use LINQ to objects to find the maximum item in each group. Consider this scenario: I have a list of students in this case, along with their grades and marks. Our aim is to determine the student, grade,…
This post is a simple, fun example. In this post, I will show you a neat trick about LINQ. You have to reverse a given sentence using LINQ. For example Input I love LINQ Output LINQ love I There are several ways to solv…
LINQ (Language integrated query) is a compelling feature of c#. By using LINQ, we can simplify the code very easily in fewer lines of code. In this example, I will show you how to convert an array of string to the collection…
As per the MSDN 'Linq` is Language-Integrated Query (LINQ) is the name for a set of technologies based on the integration of query capabilities directly into the C# language. LINQ provides a lot of operator out of the bo…
In this article, I will show how to find nth highest salary using LINQ. This is a very popular SQL interview question. The purpose of this article is to show you the LINQ operator that we can use to achieve the goal, not the …
In relational database terms, an inner join produces a result set in which each element of the first collection appears one time for every matching element in the second collection. If an element in the first collection has…
A left outer join is a way of joining tables together. Unmatched entries from only the table given before the LEFT OUTER JOIN clause are included in the result. Use a LEFT OUTER JOIN clause or a RIGHT OUTER JOIN clause when …
Linq Where equivalent in Ruby One of the most used (just guessing) LINQ methods would be Where() , in .NET allows you to provide a Lambda that is used to filter a collection of objects var ints = new [ ] { 13 , 42 , 9…
LINQ is a very popular feature of C#. You can write complex code in a lesser line. In this post, I will show you some one-liner Lambda expression. Write a factorial function using the lambda expression Func < int , int …