Top "Linq" questions

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

IEnumerable vs List - What to Use? How do they work?

I have some doubts over how Enumerators work, and LINQ. Consider these two simple selects: List<Animal> sel = (…

c# linq list ienumerable
Concat all strings inside a List<string> using LINQ

Is there any easy LINQ expression to concatenate my entire List<string> collection items to a single string …

c# linq .net-3.5
Get a list of distinct values in List

In C#, say I have a class called Note with three String member variables. public class Note { public string Title; …

c# linq list distinct
How to get the index of an item in a list in a single step?

How can I find the index of an item in a list without looping through it? Currently this doesn't look …

c# linq lookup
Use LINQ to get items in one List<>, that are not in another List<>

I would assume there's a simple LINQ query to do this, I'm just not exactly sure how. Given this piece …

c# linq .net-3.5
Select Multiple Fields from List in Linq

In ASP.NET C# I have a struct: public struct Data { public int item1; public int item2; public int category_…

c# linq data-structures
LINQ to read XML

I got this XML file: <root> <level1 name="A"> <level2 name="A1" /> <level2 …

c# xml linq linq-to-xml
How do I use LINQ Contains(string[]) instead of Contains(string)

I got one big question. I got a linq query to put it simply looks like this: from xx in …

c# linq string contains
Linq style "For Each"

Is there any Linq style syntax for "For each" operations? For instance, add values based on one collection to another, …

c# .net linq foreach
How to do SQL Like % in Linq?

I have a procedure in SQL that I am trying to turn into Linq: SELECT O.Id, O.Name as …

.net linq tsql linq-to-entities sql-like