score:3
Accepted answer
basically, you have to condense your where clause into a single where clause after all of the navigations (from
) have been performed, like so:
var query =
from ch in client.wcf.context.cashheading
from cs in client.wcf.context.cash
from gg in client.wcf.context.good
where
ch.id_customer == customern && //cc.id
cs.id_cashheading == ch.id &&
gg.id == cs.id_good
select gg.price.value;
granted, this doesn't seem optimal, as it would seem that it's going to do cross join all of the tables and then perform the filtering, but remember, you're probably dealing with iqueryable<t>
interface implementations, meaning that this will more than likely be interpreted and then optimized by whatever handles the translated queries.
Source: stackoverflow.com
Related Query
- Why this Linq doesn't work (Error translating Linq expression to URI: Can only specify query options (orderby, where, take, skip)
- Unit test error : This function can only be invoked from LINQ to Entities
- Why doesn't this LINQ Select expression work
- How can I make this SQL query work in LINQ lambda expression
- Why does my linq expression only work when broken into two parts?
- C# LINQ: DbFunctions.TruncateTime throw error This function can only be invoked from LINQ to Entities
- C# LINQ GroupBy error Only one expression can be specified in the select list
- linq exception : This function can only be invoked from LINQ to Entities
- Why is this linq expression not working?
- Why doesn't using a nullable Guid work in this linq query?
- Can someone explain LINQ's intersect properly to me? I don't understand why this doesn't work
- How can I combine this code into one or two LINQ queries?
- Why does .Equals not work in this LINQ example?
- How can I further simplify this piece of LINQ code
- DbFunctions.DiffDays() results in: This function can only be invoked from LINQ to Entities
- Why does the StringComparison.InvariantCultureIgnoreCase not work with this Db4o linq query?
- Why does this LINQ expression break my loop & conversion logic?
- Why is this output variable in my LINQ expression NOT problematic?
- Why do casting to (int?) work while (string?) doesnt in LINQ queries
- Why orderBy does not work for this linq expression?
- Can any one solve this Linq error -?
- LINQ: Why am I getting error on this LINQ Query?
- Why doesn't this LINQ query work as expected?
- why does this linq code get exponentially slower when applying First() to projection?
- Can this LINQ Expression be converted from method syntax to query syntax?
- Why does this work but the other one fails( Linq To Xml)
- Using Linq to build a graph class; can you make this code look better?
- Convert this LINQ code back to a Loop (or Why is this object sometimes null)
- How can I refactor this code for LINQ filtering?
- LINQ related error "Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context
More Query from same tag
- Comparing two strings containing multiple dots inside a Linq to Sql query
- Returning multiple xml Children with same name on single node using linq c#
- make an array of item from another array in jquery
- Convert Single Object into Multiple Object c#
- Nested foreach loop to linq query
- Trying to get generic when generic is not available
- How to remove nodes based on duplicate elements in an XML?
- Linq to NHibernate vs. ICriteria
- Expression<Func<T,bool>> - How to Handle Ambiguous Method Signatures?
- Why do I need LINQ if I use NHibernate-like ORMs?
- Group List by property then return only another property of this grouped objects
- Linq-to-SQL: Ignore null parameters from WHERE clause
- LINQ group by then order groups of result
- How do I write this lambda select method in VB.net?
- Entity framework Select first item in group that satisfies condition or just first item
- MemoryStream, XmlTextWriter and Warning 4 CA2202 : Microsoft.Usage
- Calling .Contains on the output of a Expression<Func<T,string>>
- Sql to Linq difficulty - group by, having
- Linq + Where + abstract method = LINQ to Entities does not recognize method
- How to split string by delimeter and multiple group by and count them in Linq?
- Using ASCII equivalent in LINQ
- Get List of DataKeyValues from RadGridView using LINQ
- AutoMapper ProjectTo fails with FirstOrDefault
- How to do Linq query update
- Linq Getting Customers group by date and then by their type
- Dynamic Linq Library Help
- How to combine the results of two DTOs in C# into one list of one type
- Ordering List with Child Items
- How to force Linq to update last edit time of a row?
- Efficiency with the Linq Contains method where parameter is an array