score:0
i don't undersant what do you want ? if you want the competition which have events with results infos in 2013 and result infos also in 2013 you can do this :
model.where(c => c.childevents
.selectmany(ce => ce.resultinfos)
.where(ri => ri.season == 2013).count() > 0
&&
c.resultinfos.where(ri => ri.season == 2013).count() > 0)
.tolist();
but i'm not sure that i undersand what you need
score:1
you can do:
var competitions = new competition(); // populated competition class
var results = (from c in competitions
from e in c.childevents
from ri in e.resultinfos
where ri.season == 2013).tolist();
it's unclear why you need an additional where
but you could extend it and have another clause such as
where ri.season == 2013 && eventname == "event"
as @von.v has pointed out, you can access resultinfos
directly via the competition class, so you can simplify it via:
var results = (from c in competitions
from ri in c.resultinfos
where ri.season == 2013).tolist();
Source: stackoverflow.com
Related Query
- Linq statement with two where clauses
- LINQ Query with two COUNTs based on different parameters in Where statement
- Multiple WHERE Clauses with LINQ extension methods
- Linq Query with a Where clause in an Include statement
- Entity Framework Core LINQ query with multiple where clauses
- Linq Dynamically append Where clauses with OR
- Linq with optional Where clauses and Sql Server CE
- Use == operator with generic type in a Where Linq statement
- Linq with where clause in many-to-many EF Code First object
- using linq with join using two where on two tables
- Linq query and multiple where clauses with OR only first condition gets evaluated
- Split list into two lists with single LINQ statement
- Entity Framework - LINQ statement with WHERE clause based on NULLABLE parameter
- C# - Linq optimize code with List and Where clause
- LINQ two Where clauses
- Linq statement with mutiple OrderBy clauses not working
- Linq filtering results with multiple Where clauses
- add where clauses to linq query with generic column name
- LINQ Statement with where clause makes the execution slow
- Need help with adding Where clauses in loop with Linq
- Linq to Datatable with multiple where clauses
- Comparing two LINQ queries, where statement Hasvalue vs !=null
- JSON.net linq can not select node with where statement
- linq where statement with OR
- How to convert multiple SQL LEFT JOIN statement with where clause to LINQ
- LINQ LEFT JOIN, Combine multiple WHERE clauses with OR
- How to dynamically get a property value in which is in another property with Linq where statement
- C# LINQ join with conditional where clause on two different data sets
- Linq statement with 2 joins a where and need a count
- How to Create a Linq Query with Multiple Conditional Where Clauses
More Query from same tag
- Compare lists and return objects that doesn't exist
- How to use EF Core extension methods asynchronously
- Using Expression<Func<TSource, TKey>> with IQueryable
- Remove elements from Array that are duplicates if compared to elements in another Array
- How to query this XML in LINQ?
- From & To Date Filter on List Using LINQ working on Localhost but on IIS does not works
- Use LINQ to pull data where rows match other rows
- C# return generic list of objects using linq
- Convert row values into columns using LINQ in c#
- Convert CollectionBase to List or data type usable with Linq
- Use Linq to get values
- LINQ Join with multiple or conditions
- Sort array on one variable that can hold multiple values
- Building a query that is most efficiently finds If a range of dates is in an interval?
- could not translate expression into sql
- LINQ Query descending tree
- LINQ: multiple Where calls only uses last one?
- Using except operator with property condition
- Attempt pivot query results onto an object, using linq or otherwise
- Group by generates a huge query
- Can't UPDATE using Linq
- Entity Framework Linq recursive search To a List
- How to have this result with Linq Request?
- Mapping complex object to dictionary using LINQ
- I populate a list<string> with linq, but the order of the items is random
- How to get the difference of two list in C# using LINQ
- Nhibernate Linq Get<T> object by name not by Id
- Combining two LinQ queries
- Dynamic LINQ Compare Dates in Entity Framework
- Create a sequence of two letters of length 10 using Linq