Top "Linq-to-objects" questions

The term "LINQ to Objects" refers to the use of LINQ queries with any IEnumerable or IEnumerable<T> collection directly, without the use of an intermediate LINQ provider or API such as LINQ to SQL or LINQ to XML.

Is null checking required for IEnumerable object?

var selectedRows = from drow in ugTable.Rows .Cast<Infragistics.Win.UltraWinGrid.UltraGridRow>() .Where(drow => drow != null &&…

c# .net linq linq-to-objects
Replace a collection item using Linq

How do I find and replace a property using Linq in this specific scenario below: public interface IPropertyBag { } public class …

c# linq linq-to-objects .net-3.0
Sequence contains no elements exception in linq without even using Single

I am not using Single in LINQ below, but I am still getting a 'Sequence contains no elements' exception: allNames = …

c# string linq linq-to-objects sequences
Linq nested list expression

please I need your help with a Linq expression: I have nested objects with lists, this is how the main …

c# linq lambda linq-to-objects
Getting keys from a Lookup

How do I get the collection of keys from a Lookup<> I created through the .ToLookup() method? I …

c# .net linq linq-to-objects lookup
LINQ to SQL and a running total on ordered results

I want to display a customer's accounting history in a DataGridView and I want to have a column that displays …

c# linq linq-to-sql linq-to-objects
linq orderby.tolist() performance

I have an ordering query to a List and calling for many times. list = list.OrderBy().ToList(); In this code …

c# performance sql-order-by linq-to-objects tolist
Recursive control search with LINQ

If I wanted to find checked check boxes on an ASP.NET page I could use the following LINQ query. …

asp.net .net-3.5 c#-3.0 linq-to-objects
LINQ - is SkipWhile broken?

I'm a bit surprised to find the results of the following code, where I simply want to remove all 3s …

c# linq linq-to-objects
Using LINQ to parse the numbers from a string

Is it possible to write a query where we get all those characters that could be parsed into int from …

c# linq string c#-4.0 linq-to-objects