score:3
TempProjectionItem
is the element type of the sequence... just like an IEnumerable<int>
(such as a List<int>
) is a sequence of int
values without int
itself implementing IEnumerable
.
Note that there are two sequence interfaces: System.Collections.IEnumerable
and System.Collections.Generic.IEnumerable<T>
. Obviously the latter is generic, representing a sequence of a particular type. So temp
is a sequence of TempProjectionItem
elements, and query
is a sequence of string
elements.
Neither of these is really a collection as such - the queries are executed lazily - it's only evaluated (starting with names
) when you iterate over the data. Iterating over query
involves iterating over temp
which then iterates over names
.
score:0
IEnumerable is an interface, isn't it?
Yes, it is. Actually in your code you are using IEnumerable<T>
which is a generic interface.
What kind of object is temp and query?
In your code we can see temp is type of IEnumerable<TempProjectionItem>
, while query is an IEnumerable<string>
, both of which come from IEnumerable<T>
.
Why does TempProjectionItem not need to implement IEnumerable?
TempProjectionItem is not IEnumerable, it's just an item of the IEnumerable<TempProjectionItem>
which is a "container".
Source: stackoverflow.com
Related Articles
- creating Linq to sqlite dbml from DbLinq source code
- C# LINQ/Object Initializers Example from C# 4.0 in a Nutshell
- Linq code to get the index of an object in an array from an object within a list
- LINQ example code from microsoft...
- c# Linq or code to extract groups from a single list of source data
- Create a list from two object lists with linq
- How to get first object out from List<Object> using Linq
- Create a list of one object type from a list of another using Linq
- Linq select object from list depending on objects attribute
- Linq to SQL: How do I stop the auto generated object name from being renamed?
- linq remove item from object array where property equals value
- How can I set properties on all items from a linq query with values from another object that is also pulled from a query?
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- Using Linq on a Client Object model result from sharepoint
- Select object from nested collection using Linq
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- LINQ - SelectMany from multiple properties in same object
- Linq - merging sub lists from different objects into a single object
- How to pass LinQ Expressions from F# to C# code
- LINQ - Select all children from an object hierarchy
- Using LINQ to delete an element from a ObservableCollection Source
- How does linq actually execute the code to retrieve data from the data source?
- LINQ Source Code Available
- Linq with where clause in many-to-many EF Code First object
- How to return LINQ object from method?
- How to create a list from filtering 2 lists with linq to object
- Combine two LINQ queries from different sources into single object
- When selecting an anonymous type with LINQ from EF, is there no way to run a method on an object as you select it?
- How to fill a property of an object from another list using LINQ
- Object initializers in a LINQ query - is it possible to reuse calculated data?
- Add between clause in a LINQ expression with OR operator
- Can LINQ construct and return a multidimensional array
- LINQ or ADO.net Entity Framework - which to learn?
- asp.net mvc 3 EF HTML MultiSelect - How to retrieve multiple values using LINQ
- Linq query for below data
- linqpad hide specific column or restrict row to single line
- Filtering XElements by descendent element's attributes
- Filter some unique Data with LINQ and C#
- How can I implement Query Interception in a LINQ to Entities query? (c#)
- LinqtoSQL Getting a value from another table
- Linq full outer join with NULL records C# from datatables
- Getting the count of most repeated records in Linq
- Getting a single element from LINQuery?
- GroupBy with property in a nested child collection
- Populating a AutoCompleteBox with a list of anonymous types
- Linq Query to display string from XML in a TextBox
- Sorting a list<class> alphanumerically in c#
- Nhibernate Linq Get<T> object by name not by Id
- Nhibernate and linq problem
- Chain Lambda Linq