score:4
Accepted answer
how can i return a count of mylist items where mylist.defects contains a null object?
return mylists.count(ml => ml.defects.contains(null));
score:4
return mylists.count(ml => ml.defects.any(d => d==null));
Source: stackoverflow.com
Related Query
- LINQ Find Null Objects in List
- Find child objects in list of parent objects using LINQ
- sorting list of objects with null properties using linq
- Linq query to find duplicate objects based on multiple fields AND property is null
- C# LINQ Find List Inside Another List, Better way to code this than a foreach loop
- LINQ - Find index of a list item that has a null value
- LINQ query to find objects in list with equal values for one of their properties
- C# Linq Find value inside list of objects inside a list of objects
- c# Linq or code to extract groups from a single list of source data
- LINQ Query - Find objects in a list who's lists contain objects with a certain property
- C# LINQ find duplicates in List
- Searching if value exists in a list of objects using Linq
- Find an item in a list by LINQ
- Linq select objects in list where exists IN (A,B,C)
- Using Linq to group a list of objects into a new grouped list of list of objects
- LINQ query to return distinct field values from list of objects
- LINQ query to find if items in a list are contained in another list
- LINQ - Find all items in one list that aren't in another list
- LINQ select one field from list of DTO objects to array
- Using LINQ to find item in a List but get "Value cannot be null. Parameter name: source"
- Using LINQ to group a list of objects
- Using LINQ to Objects to find items in one collection that do not match another
- Linq select object from list depending on objects attribute
- Find first element of certain type in a list using LINQ
- Linq query between two list objects
- LINQ Lambda - Find all ID's in one list that don't exist in another list
- Distinct list of objects based on an arbitrary key in LINQ
- Change the property of objects in a List using LINQ
- Linq to Objects - return pairs of numbers from list of numbers
- Linq Select New List Property Null Check
More Query from same tag
- Using Linq to XML instead of XML Reader/Writer
- DataGrid doesn't refresh after adding new data from another view WPF C#
- Creating reduced json from a bigger json in c#
- Compile Expression at runtime Using Serialize.Linq
- group list by property and where it appears more than once
- Convert SQL to Linq select in where
- Does an expression enumerate parameters when executed in LINQ?
- Oracle, Linq and sorting children
- Perform a lookup between C# Lists and return matched where value is minimum
- Reading XML data using LINQ, multiple elements with the same name
- Substring when a string contains, Linq syntax
- Adding multiple ORDER BY clauses to an NHibernate query throws exception
- C# unchecked keyword in lambda expressions
- How to access data into IQueryable?
- Return last 10 days data by date using Entity Framework
- Double group into Dictionary<int, Dictionary<string, List<Model>>>()
- LINQ to XML: Collapse mutliple levels to single list
- grouping and Update Property in linq
- linq Command not getting the answer for DB
- using multiple IEnumerable Joins
- Selecting Child Node of XElement with LINQ Group By
- How can LINQ actions be performed on a CollectionBase?
- Selecting one to many which one is better
- Left Outer Join LINQ To Entities
- Searching all public variables of objects in List<T> for specific string
- Method 'SingleOrDefault' not supported by Linq to Entities
- Linq - Question concerning the 'Any' method
- Building Nhibernate Clauses With Custom Expressions
- (Fluent) linq group by strong type
- The variable return zero