score:1
Accepted answer
var result = npcdata.where(
n => n.active == true ||
eventdata.any(e => e.can_display == true && e.npc_id == n.id)
);
Source: stackoverflow.com
Related Query
- C# LINQ Find List Inside Another List, Better way to code this than a foreach loop
- better way to do this foreach using linq
- How to code this LINQ query in a better way
- Is there a better way to code this LINQ fragment?
- Is there a way to search in Dictionary<int[], List<int> by values inside values faster than this code already does?
- Is there a better way to achieve this with Linq or a better code
- Better way to write this C# Code For List of Lists
- 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 Lambda - Find all ID's in one list that don't exist in another list
- why ForEach Linq Extension on List rather than on IEnumerable
- Using Linq query inside List<T>.AddRange to conditionally add elements from one list to another
- Is there a better way to set a property common to a list of items in linq
- How do I use Linq to find the elements of a list that are not present in another list?
- Better way to write this linq query?
- C# linq Select objects in list looking inside another list of objects
- What's the better way to write this linq query?
- Is this really a case when Linq is faster than a Foreach
- C# LINQ - Return a typed filtered list based on a child property that is inside another list
- Conditional UNION in LINQ (or is there a better way than UNIONs)?
- How to write this LINQ Query in a better way
- c# find item in list returned by LINQ query and compare its value with another item in list
- Is there a better way to search a list with another list
- Most efficient way to find a "space" in an ordered list using LINQ
- Better way of searching through lists than using foreach
- LINQ Filter List inside another LINQ Query
- Is there a better way of shortening this LINQ statement?
- How to remove selected data that found on another list and take last 6 id through LINQ without foreach loop
- Is there a better way of writing this Linq Query
- is there a better way to write this frankenstein LINQ query that searches for values in a child table and orders them by relevance?
More Query from same tag
- If I have a collection of classes how can I return a collection of a single attribute of all the classes?
- LINQ Exception handling
- Enumerating stored procedure result - The result of a query cannot be enumerated more than once
- linq query generate defferent results
- Save data of linq query for later comparison
- Split logic from a lambda expression to mutliple LINQ Expressions
- sql Left join with linq lampda expression
- Linq Data Source WhereParameters with "\" in value
- How to get table record count by passing table name as parameter using LINQ TO SQL
- Handle null element in linq
- Order by in linq on joining
- Linq Statement Difference.
- Create Dictionary and use key in value expression declaration
- how to mock ITable with a concrete type
- Select list of x via list of y
- how to map a computed column in linq to sql classes
- Flatten/Merge List using Linq
- for in for optimization
- LINQ to Entities chaining commands with differing results
- How does LambdaExpression resolve to Expression<Func<T, returnT>> at runtime via dynamic?
- LINQ statement using Orderby and Distinct in sub query
- Variable to which Linq Query assigned has never the value of NULL
- How to filter with Linq
- C# Dictionary of Dictionaries returns null value from select when matched on key reference
- Replacing characters in a string with another string
- Find whether a List of type is contained in a List of Lists of type
- orderby function giving exception as "at least one object must implement icomparable" when i have a List<> in another List<>
- IEnumerable<IEnumerable<int>> - no duplicate IEnumerable<int>s
- LINQ - Conditional navigation in list
- LINQ: Compare two lists and count subset