score:3
Accepted answer
You can join all the tables:
from t3 in Table3
join t2 in Table2 on t3.Table2_FK equals t2.ID
join t1 in Table1 on T2.Table1_FK equals t1.ID
where t2.property == "some value" && t1.property == "some other value"
select t1;
(edit)
I doesn't go just one level deep. In fact, your first example should work. Of course, your relations must be N to 1:
Table3 (n) --- (1) Table2 (n) --- (1) Table1
given t3
of Table3
you can do:
t3.Table2.Table1
Do you have the proper connection between Table2
and Table1
in the .dbml
file?
Source: stackoverflow.com
Related Query
- Multiple layers of foreign keys in LINQ query
- AP.NET webforms using LINQ to SQL datasource and databind with foreign keys across multiple tables
- Strongly Typing a LINQ Query using multiple keys of complex objects
- Building a Linq Query for multiple Foreign tables
- Using navigation properties in linq query throws error if foreign keys are null
- LINQ query : Get all fields including Foreign keys
- Multiple Null Foreign keys group join error in Linq
- How to Update multiple tables with foreign keys using LINQ expression ASP.NET MVC Entity Framework
- Entity framework linq query Include() multiple children entities
- Can I select multiple objects in a Linq query
- How to apply multiple orderby in linq query
- Selecting multiple columns with linq query and lambda expression
- LINQ query to perform a projection, skipping or wrapping exceptions where source throws on IEnumerable.GetNext()
- Linq query with multiple Contains/Any for RavenDB
- LINQ left outer join query error: OuterApply did not have the appropriate keys
- linq to sql query with multiple where parameters
- Deleting multiple records with Entity Framework using a single LINQ query
- Does this LINQ code perform multiple lookups on the original data?
- LINQ query to match multiple words
- LINQ query with a WHERE clause with multiple conditions
- LINQ to SQL: Complicated query with aggregate data for a report from multiple tables for an ordering system
- Linq query join one table row to another table multiple row
- Multiple on clause in LINQ to DataTable Join Query
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- C# multiple variables in lambda expression inside LinQ query
- Multiple foreign keys to the same table
- Linq query with multiple OrderBy statements added in a loop
- LinQ query with multiple tables and extracting data
- How to reuse a linq expression for 'Where' when using multiple source tables
- LINQ Query Returning Multiple Copies Of First Result
More Query from same tag
- Keeping sibling reference while combining items
- LINQ - type arguments cannot be inferred from the usage in a select
- NHibernate linq - Use lambda expression in place of formula attribute on mapping
- Assigning a lambda expression causes it to not be executed later?
- linq grouping ID base and insert common data into new Array
- Cross join on two DataTables using LINQ
- Combining information from multiple lists
- using variables in a dynamic linq query
- executing an object's method from multiple lists using linq
- How to do Linq Many to Many join with or without navigation properties
- Returning top 50% of list whilst evenly splitting rows between object property
- How to roll my own Jagged Foreach?
- EF Core 3.x - simple LINQ with Include can not be translated, client evaluation
- Does modeling entity-relationship using SQL Server built-in "Diagrams" have performance benefits on the execution of queries?
- Linq groupby issue
- How to check for existence of an element with XElement?
- Why GetFiles from a remote folder using Linq is hanging
- LINQ to Entities with inline function not recognized
- QueryExpression vs. FetchXml CRM2011
- LINQ way to check Contains in a List (regardless of white spaces)
- Clean up XML LINQ query
- How can I return array elements specified in one line using an array of indexes?
- Having Single and SingleOrDefault to throw a more succinct exception
- Creating dynamic Expression<Func<T,Y>>
- Using string in place of property name (LINQ)
- Creating a DataTable From a Linq Query in my C# Windows form
- Swap array keys and values in C# in a functional-programming compatible way
- Linq group by clause with eager loading
- Filtering DataTable with LINQ
- Linq expression to join a list and a dictionary