score:13
score:4
Try this:
enumerable.Cast<IFoo>().ToList();
score:4
someCollection.Cast<IFoo>().ToList()
Source: stackoverflow.com
Related Query
- How can I convert IEnumerable<object> to List<IFoo> where each object is an IFoo?
- How can I convert Linq results to DTO class object without iteration
- How can I use Linq to build a c# object from xml where an element has zero or more elements of the same type?
- How can I create list of nested classes where a certain property of each nested class is true?
- Having a List<string> where rows can be the same value, how to add a int to make each row unique?
- How can i convert this code snippet into LINQ format?
- How can I convert each record from query result to arraylist c#
- How can I convert IQueryable expression object into LINQ expression?
- How can i convert Char to Datetime in Linq Where clause
- How can convert Xml code to linq
- How can I get LINQ to return the object which has the max value for a given property?
- How can I convert a list of objects to csv?
- How can I convert a lambda-expression between different (but compatible) models?
- How can I convert anonymous type to strong type in LINQ?
- How can I convert IEnumerable<T> to List<T> in C#?
- how can I convert IQueryable<string> to string?
- How can I set properties on all items from a linq query with values from another object that is also pulled from a query?
- LINQ: How to convert the nested hierarchical object to flatten object
- How can I convert a DataTable to an IEnumerable<Dictionary<string, object>>?
- How can I Create a Expression.Property of a child object
- How can I find object in List with Linq?
- How can I create a conditional where clause using LINQ
- How can I convert DateTime to String in Linq Query?
- How can I convert this SQL Query into LINQ (OVER (PARTITION BY Date))
- How can i write SQL update query with where clause in Entity Framework in C#
- How can I use Entity Framework on an object graph past a depth of 2 with MySQL Connector / NET?
- How to convert a 2-d array into a dictionary object
- Where can I view LINQ source code?
- When using a LINQ Where clause on a Dictionary, how can I return a dictionary of the same type?
- How can I use LINQ to project this parent and children object model into a flat, single object?
More Query from same tag
- MVC SqlQuery and a 2nd sort
- Linq - Correct format for Left Join
- Trying to follow the example for ToTraceString(), but it fails. Why?
- Predicate Builder in MVC 3
- C# Linq Parent Children FK
- How to enumerate over nested enumerators
- return list while keeping only items in sublist on condition C#
- Dynamic columns into JSon
- Statement doesn't return all entities
- Copy subset of items from one RadComboBox to another
- Error on applying linq to List
- Linq OrderBy sort rule
- How to get a table into a subclass?
- Linq to SQL DataContext Lifetime Management Issue
- How to use linq to split a list of objects by half and then group them
- Linq GroupBy with each null value as a group
- Linq dynamic expression for filtering navigation properties and collections
- SQL in Linq: Group & Max for every column
- C# - array index vs LINQ?
- Is it possible to compose System.Linq.Expressions.Expression from smaller expressions?
- how to create a left join query for a many to many related table with LINQ
- Linq Query Join to Subquery with In clause
- How can I order query by SelectListItem?
- Retrieving 10 records at a time only using LINQ
- Dynamic linq query expression tree for sql IN clause using Entity framework
- Bitwise enum (flags) query using MongoDB's official C# driver
- Odata Linq Expand, How I can select the columns I need
- How can I group by the difference between rows in a column with linq and c#?
- Creating Dict<enum, List<objec>> from List<object> using LINQ C#
- Strange behavior of Entity Framework query