score:3
No. Basically query expressions exist in order to keep this stuff away from you. There's no particularly simple way of mimicking transparent identifiers.
I find that when you hit transparent identifiers, it's almost always cleaner to use query expression syntax. It's definitely worth knowing both, as very simple queries are cleaner using method syntax, but the more complicated the query, the more likely it is to be easier to read using query expressions.
That's assuming it can all be represented with method expressions, of course. Don't forget you can break up queries into separate statements without changing the meaning, so if you do need to call methods which don't have query expression equivalents, I sometimes find it best to separate it out like this:
var foo = from x in y
join a in b on x.Z equals a.Z
select new { a, x };
var bar = foo.Skip(5)
.Take(10)
.ToList();
I find that cleaner than just using brackets to mush the two syntax forms together.
Source: stackoverflow.com
Related Articles
- LINQ, can I write cleaner joins with method syntax?
- How to convert Linq expression with multiple joins into method syntax OR retrieve select index?
- LinQ method syntax multiple tables with .where() and without joins
- GroupBy with linq method syntax (not query syntax)
- JOIN and LEFT JOIN equivalent in LINQ with Method Syntax
- LINQ Method Syntax with INNER and OUTER Join
- Problems trying to use GroupBy with multiple properties using the LINQ Method Syntax
- Convert linq query expression with multiple froms into extension method syntax
- LINQ syntax for CONTAINS method with an inclusive "filter"
- Calling method with linq syntax based on condition
- Conditionally Insert Where Clause in LINQ Method Syntax with Select Many
- multiple linq joins with anonymous types using lambda syntax
- LINQ method syntax to group by a column, pick one element from each group with total count per group
- LINQ Join on multiple columns with different record using extension method syntax
- How To Introduce a Void Method to a LINQ Query with Query Syntax
- How do I write Joins between multiple tables with Linq and ASP.Net Forms
- method syntax for linq query with multiple from clauses
- LINQ syntax for SQL query with multiple inner joins and aliases
- Write LINQ query without select or group clause using extension method syntax
- Entity Framework - convert LINQ method chain with SelectMany to query syntax
- how to write a Linq query with a EF code first Many to Many relationship
- Linq query syntax to method syntax when using multiple joins to introduce dynamic restrictions
- Column getting lost in LINQ with Method Syntax after group by
- Combining LINQ queries with method syntax
- How to retrieve multiple column values with same foreign key id using Linq method Syntax in C#?
- Convert LINQ method syntax with method withing .Select() to LINQ query syntax
- How to write a properly joined query with method based syntax in Entity SQL?
- Is there a solution that will convert the following LINQ Query Syntax to Method Syntax with Lambdas
- Translate SQL SERVER SELECT to LINQ with multiple join Method Syntax
- LINQ Query with method syntax
- How to filter DataRow column containing url in c#
- Convert DateTime? to string in dd-MM-yyyy
- Sorting timespan using linq with custom string requirement
- How can I reduce IEnumerable<IEnumerable<Foo>> to IEnumerable<Foo>?
- NHibernate.Linq, WCF RIA Services, weird error
- Why am I seeing a difference between.Cast<int>() and .Select(a => (int)a)?
- c# - LINQ select from Collection
- Performance Difference between LINQ and Stored Procedures
- How to join Consecutive Date Ranges in linq
- LINQ Left Outer Join with conditions
- LINQ: Grouping SubGroup
- Best data type for a dynamic DataGridView
- Provide the correct data type in the generated parameterized dynamic sql (Entity Framework 6)
- Merging n Dictionary instances & execute action on duplicate keys
- LINQ Expression Tree Parsing Issue
- entity framework delete record
- How to get all elements from linq query?
- Filtering GroupJoin Query
- Expression Tree Multiple Entities
- Update Asp.net app to Npgsql 3 and removing Preload Reader