score:20
Accepted answer
Use the Any
extension method.
bool exists = myVar.Any(x => x.MyName == "Bob" && x.MyJob == "Taxi Driver");
score:6
You can use .Any()
Example :
bool mExists = myVar.Any(x => x.MyName == "Bob" && x.MyJob == "Taxi Driver");
Source: stackoverflow.com
Related Articles
- Find in List<t> and return boolean if found
- Avoid extra loop and could not find implementation of query pattern for source type int Select not found
- C# Linq to find a record that matches a condition, if that record is found return all related records
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet` 'Where' not found
- error :Could not find an implementation of query for source type datatable and join not found while trying to join two datatables
- How do I find the text within a div in the source of a web page using C#
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type
- why is this linq query return a boolean and not the first result of the select?
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- Could not find an implementation of the query 'Select' not found
- LINQ Source Code Available
- .NET 4 Code Contracts: "requires unproven: source != null"
- LINQ query to return whether an item is found in an array?
- using linq query to find value that differs from previously found value
- Return 0 if no duplicates found from DistinctBy
- C#: linq return boolean instead of string
- c# - LINQ find 2D jagged array minimum, return index
- Could not find an implementation of the query pattern for source type
- How to find the next greater available record in SQL if the one that I entered is not found
- creating Linq to sqlite dbml from DbLinq source code
- Linq code doesn't return correct record
- Should my query return null when it doesn't find any items?
- Find overlapping dates in 2 lists and return overlapping period
- LINQ - Return Value From Field With A Max Value if No Rows Found
- what does a linq query return when no results are found
- Getting "Could not find an implementation of the query pattern for source type 'ExcelQueryable<T>'. " Error
- Linq query where First() appears to return null when results are not found
- Lambda expression not correct - need to return a boolean Func
- Given a list of color objects, find the most/least frequently existing color, and return that as a color object
- System.Void' is not a valid return type for a mapped stored procedure method
- Using Dynamic Column Names in a Linq Query
- Santax for Joins using Linq/lambda & Nhibernate
- Converting list with nested list to a separate list using Linq
- Linq logic in the select statement
- Linq - How to apply a where clause on the maximum element of a list
- Find distinct value of one field in a period
- Images within show c# code that I am confused about
- Take the first five elements and the last five elements from an array by one query using LINQ
- How can I add an extra item in this LINQ query?
- Matching records on multiple combinations of fields
- Calling a SQL Server stored procedure with linq service through c#
- Navigational Property not materialized in Linq Query Syntax also Lazy Loading didnt work
- Populate List<T> inside of List<T>
- LinqKit nested invoke "LINQ to Entities does not recognize the method 'Invoke'"
- Linq Queries - How to join the below two group by queries? On Course ID
- C#/Linq get sets with adjacent
- How to retrieve the values from list using indexes by linq query?
- Compare same DataTable by certain columns, return mismatches to CopyToDataTable()
- linq to sql select specific cell