score:2
Accepted answer
as far as i am aware include
does not support this type of sub-querying. your best option is to use projection e.g.
list<developmenttype> devtypes =
defaults.include(x => x.defaultcharges)
.include(x => x.overridecharges)
.select(x => new {
devtype = x.developmenttype,
zones = x.overridecharges.where(oc => oc.chargingschedule_rowid == cs.rowid)
.select(oc => oc.zone).tolist()
})
.select(x => x.devtype)
.tolist();
Source: stackoverflow.com
Related Query
- Linq - where inside include
- Write where condition inside Include in linq query
- Linq Where Inside Include
- EF 6, LINQ how to create where inside include with conditional parameter
- C# linq include before-after where
- LINQ query to perform a projection, skipping or wrapping exceptions where source throws on IEnumerable.GetNext()
- LINQ To Entities Include + Where Method
- Syntax to execute code block inside Linq query?
- Linq Query with a Where clause in an Include statement
- Delete inside foreach with linq where
- LINQ WHERE method alters source collection
- Where can I view LINQ source code?
- IF statement inside a LINQ SELECT to include columns
- Does the order of the include and the where matter in a LINQ query?
- LINQ Source Code Available
- Linq with where clause in many-to-many EF Code First object
- Where inside a where in linq
- Linq include with where clause
- When Where clause is used inside Linq statement produces different results than when used outside
- Include where clause on linq query when param is not null Npgsql
- C# - Linq optimize code with List and Where clause
- Condition inside linQ Where condition
- creating Linq to sqlite dbml from DbLinq source code
- Using LINQ with MVC, how can I include multiple parameters into a where clause?
- LINQ operater Where not supporting any of the members when used inside generic method
- LINQ to Entities: queryable extension method not reconized inside where condition
- How to use IN Operator inside Where Condition in Linq
- Error "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities" in where clause inside the method
- C# LINQ performance when extension method called inside where clause
- Linq Include and Where Clause
More Query from same tag
- LINQ statment looks unreasonable to me: what's my error?
- Counting orders and grouping them, linq to sql
- Populating a list within a list in C# not using foreach loop. better way?
- Combine two LINQ queries returning bool to one returning bool?
- C# Linq join transforming the two entities into DTO but provide a count of one of those entities
- Fast autocomplete from in-memory collection (.NET)
- C# MVC - Filter results based on eNum value passed in querystring to Controller
- System.Data.EntityProxies group by keeps doing tons of selects GroupBy linq
- Select value and flatten sublist of objects within a list of objects
- Using LINQ and a dropdownlist to enter a new record into an SQL Database
- must retrieve the list from the database
- Linq Where Clause Change based on Parameters
- How to sort null as the first item?
- SQL to LINQ conversion failed
- How to add OrderBy clause in multi-table LINQ query?
- identify at least 1 column having a value + MVC Linq
- Filtering list with another list PowerShell
- Find (and extract) complex correllations to find rule violations
- Adding rows from one IEnumerable to another based on conditions
- LINQ in SQLite for Windows store app does not have 'ThenBy' to order by multiple columns
- why does these queries generate different sql?
- A problem with compare item value
- Passing a null value as a string
- LINQ to Datatable - How to add an if condition in linq query where clause?
- How can I add a new text box to my WPF from a DataSet?
- Is possible to column as Row using Linq and show on View?
- Load only necessary data Linq to Sql and ExpandoObject
- Linq how to filter an object list based on overlap of nested list property and external list
- LINQ sorting by number of appearances
- LINQ GroupBy into a new object