Linq

LINQ in depth: advanced features and example

In this blog post, I will show you some LINQ advanced features like finding moving average, nth highest salary using LINQ, left, right join using LINQ and many more. How to extract number from string using Linq Moving Average…

How to extract number from string using Linq

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…

Moving Average In C# Using LINQ

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 with the Real World example

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 …

A practical overview of C# LINQ Aggregate operator with Example

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…

Find Highest in each group using LINQ

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,…

C# string Reverse extension method

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…

How to convert array of string to array of integer using LINQ

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…

What is the use of LINQ Zip operator

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…

Find the nth highest salary using LINQ

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 …

Perform Inner Join in Linq using C#

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…

Left outer join using LINQ

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 …

Compare Linq and Ruby Part1

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…

C# Lambda Expression One-Liners

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 …

تحميل المزيد من المشاركات
لم يتم العثور على أي نتائج