score:1
Both codes will return the same results. Both have deferred execution (i.e. nothing will actually be executed until you start enumerating the result) and stream the results (i.e. not buffered). There shouldn't be a significant performance difference between the two versions
score:2
It's definitely functionally identical (although I've assumed that the lack of a new
keyword in your LINQ example was a typo).
There's a bit of null checking in Select, but that's unlikely to significantly affect performance.
Jon Skeet has a good writeup on his blog here: http://msmvps.com/blogs/jon_skeet/archive/2010/12/23/reimplementing-linq-to-objects-part-3-quot-select-quot-and-a-rename.aspx
Source: stackoverflow.com
Related Articles
- Are these enumerations code functionally the same?
- are these two linq expressions functionally equivalent?
- LINQ Source Code Available
- Why do these three pieces of LINQ code produce different (or erroneous) results?
- .NET 4 Code Contracts: "requires unproven: source != null"
- Do these two statements mean the same thing?
- creating Linq to sqlite dbml from DbLinq source code
- Do these 2 LINQ join queries achieve the same thing
- Accessing a List multiple times in same code block - Any better approach?
- scala -> use .net (linq) and java code base in the same program?
- How to write the same code using Lambda Expression
- select from list which has same code
- source code for LINQ 101 samples
- Can I Use The Same Linq Code to Query for Different Conditions?
- Are these two linq queries of the same performance? And How to implement .Any in linq query?
- How can I extract all Unique / Distinct Rows from a Datatable and save these rows in a new Datatable with same Columns?
- LINQ Select: different projects same code different results
- List or Array of String Contain specific word in Html Source Code
- L2E these two are the same thing?
- Difference between these 2 methods that return the same value?
- Why is my code returning a list of the same object 4 times?
- Can I assign the result of a Linq query to the source variable of the same query?
- c# Linq or code to extract groups from a single list of source data
- Why can I not use the same poco in code first in EF4.1 to project my data?
- Convert string[] to int[] in one line of code using LINQ
- How to merge a list of lists with same type of items to a single list of items?
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- Value cannot be null. Parameter name: source
- How to check if all list items have the same value and return it, or return an “otherValue” if they don’t?
- Linq code to select one item
- ICollection properties Sorting in ASP.Core using LINQ
- Converting an IQueryable<int?> to IQueryable<int> after nulls have been removed
- How to conserve the Dictionary structure after the filtration of linq
- Linq Join variable scoping issue
- .NET - Attaching an entity of type failed because another entity of the same type already has the same primary key value
- Find users based on a specific role
- Converting a string into Linq lambda expression
- LINQ Group by string and count grouped property's child property
- Counting filled rows issue in datagridview using binding source in C#
- How do I determine if an entity exists in the current data context?
- How to assign the LINQ query values to a another dictionary
- Buddy ViewModel with LINQ Join
- LINQ expression to check if field contains string
- Is there a way to avoid repetition in linq projections that depend on expressions?
- Linq Selector with dynamic property name
- Write function that return data to datagridView in Entity Framework
- Selecting A Subset Of A List With A Particular Element First In The List
- LINQ order by local list
- C# Lambda : using Event<T>()
- What's the correct way to fill a DropDownList using LINQ?