Top "Linq" questions

Language Integrated Query (LINQ) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages.

LINQ with groupby and count

This is pretty simple but I'm at a loss: Given this type of data set: UserInfo(name, metric, day, other_…

c# linq group-by
Extension methods must be defined in a non-generic static class

I'm getting the error: Extension methods must be defined in a non-generic static class On the line: public class LinqHelper …

c# .net linq extension-methods compiler-errors
Linq select objects in list where exists IN (A,B,C)

I have a list of orders. I want to select orders based on a set of order statuses. So essentially …

c# linq list linq-to-objects exists
OrderBy descending in Lambda expression?

I know in normal Linq grammar, orderby xxx descending is very easy, but how do I do this in Lambda …

linq lambda
Get HTML code from website in C#

How to get the HTML code from a website, save it, and find some text by a LINQ expression? I'm …

c# html linq
How to do joins in LINQ on multiple fields in single join

I need to do a LINQ2DataSet query that does a join on more than one field (as var result = …

c# linq join
Using LINQ to concatenate strings

What is the most efficient way to write the old-school: StringBuilder sb = new StringBuilder(); if (strings.Count > 0) { foreach (string …

c# linq string-concatenation
LINQ: When to use SingleOrDefault vs. FirstOrDefault() with filtering criteria

Consider the IEnumerable extension methods SingleOrDefault() and FirstOrDefault() MSDN documents that SingleOrDefault: Returns the only element of a sequence, or …

.net linq linq-to-sql
Using Linq to group a list of objects into a new grouped list of list of objects

I don't know if this is possible in Linq but here goes... I have an object: public class User { public …

c# linq
Proper Linq where clauses

I write a fair amount of linq in my day to day life, but mostly simple statements. I have noticed …

c# linq