Top "Linq" questions

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

Sequence contains no elements?

I'm currently using a single query in two places to get a row from a database. BlogPost post = (from p …

c# linq
C# LINQ find duplicates in List

Using LINQ, from a List<int>, how can I retrieve a list that contains entries repeated more than …

linq list duplicate-removal
Remove duplicates in the list using linq

I have a class Items with properties (Id, Name, Code, Price). The List of Items is populated with duplicated items. …

c# linq linq-to-objects generic-list
Linq: GroupBy, Sum and Count

I have a collection of products public class Product { public Product() { } public string ProductCode {get; set;} public decimal Price {get; …

c# .net linq
Entity framework linq query Include() multiple children entities

This may be a really elementry question but whats a nice way to include multiple children entities when writing a …

linq entity-framework lazy-loading
C# Linq Where Date Between 2 Dates

I'm trying to get my linq statement to get me all records between two dates, and I'm not quite sure …

c# linq
Create a list from two object lists with linq

I have the following situation class Person { string Name; int Value; int Change; } List<Person> list1; List<…

c# linq
LINQ Using Max() to select a single row

I'm using LINQ on an IQueryable returned from NHibernate and I need to select the row with the maximum value(…

c# .net linq
Dynamic LINQ OrderBy on IEnumerable<T> / IQueryable<T>

I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a sql-like string (e.…

c# linq linq-to-objects