score:2
Accepted answer
the difference between iqueryable
and iqueryable<t>
is that the second is typed while the first is not. to convert iqueryable
into iqueryable<t
> you can use the cast<t>()
method.
iqueryable myqueryable = ...;
iqueryable<mytype> mytypedqueryable = myqueryable.cast<myqueryable>();
ilist<mytype> mylist = mytypedqueryable.tolist();
obviously the contents of myqyeryable
must be castable into mytype
. to select the instances of a certain type you can use the typeof<t>()
method before doing the cast.
Source: stackoverflow.com
Related Query
- How to dynamic add filters to a LINQ query against an Odata Source in C#
- Dynamic query to immediate execute?
- How to execute code as a part of the LINQ query
- Execute dynamic query with Linq in Entity Framework
- Updating List using LINQ working when execute from Immediate window, not from code direct
- Dynamic query with OR conditions in Entity Framework
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- Trim() a list of strings using dynamic query language to produce a trimmed IQueryable<string>
- Does foreach execute the query only once?
- How to execute LINQ and/or foreach in Immediate Window in VS 2013?
- LINQ query to perform a projection, skipping or wrapping exceptions where source throws on IEnumerable.GetNext()
- does converting IQueryable to IEnumerable execute the query again?
- Syntax to execute code block inside Linq query?
- Query data using "Contains" keyword in Dynamic Linq in C#
- passing dynamic expression to order by in code first EF repository
- How can I build Linq query with dynamic OR statements?
- Dynamic query using LINQ to SQL
- LINQ TO SQL, Dynamic query with DATE type fields
- Dynamic linq query expression tree for sql IN clause using Entity framework
- The best way to build Dynamic LINQ query
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- Dynamic Linq query Contains List
- Dynamic LINQ query to get Field value from Database
- Dynamic linq query with multiple/unknown criteria
- Creating a dynamic query using IQueryable
- linq query with dynamic predicates in where clause joined by OR
- How to write this Linq SQL as a Dynamic Query (using strings)?
- How does linq actually execute the code to retrieve data from the data source?
- How to cast a Linq Dynamic Query result as a custom class?
- Using LINQ Dynamic Query Library with Dictionary<string, object> and .AsQueryable()
More Query from same tag
- How to remove from an List Object in c#
- Find and Replace characters in a string based on two arrays in c#
- How to create an efficient data structure for two-dimensional LINQ operations?
- Select a specific column in LINQ web service with Entity Framework
- View or stored procedure or Linq query
- Linq and grouping with three tables
- LINQ Query find columns where string contains any letter
- Select String that is not a property of another object
- LINQ Query from Object Array Inside Database column string
- Row not found or changed LINQ C# error on simple statement
- Various ways to combine two different result sets and do the iteration and sum
- Why can't I call FirstOrDefault on Descendants("XName")
- error :Could not find an implementation of query for source type datatable and join not found while trying to join two datatables
- C# LINQ NULL check
- Compare two generic lists and remove duplicates
- Return Anonymous Type from a function
- linq query for sql xml column
- How to combine N amount of expression trees with OR/And operators
- How to use the vb equivalent of ++ for an index property in a Linq query projecting a new type
- LINQ to SQL value BETWEEN two double values
- Why does this error occur when using SingleAsync?
- Is there a way to access a private property in a where clause?
- every Parameter object property that is not null, to be added to expression predicate as a condition
- Returning Enumerable.Empty<T>().AsQueryable() a bad idea?
- How to do a linq group by
- Select items between two other items using LINQ
- Using LINQ how can I check for an instance of a number in one array, in another array?
- LINQ, Should I JOIN or use nested SELECT NEW's
- Dynamically Append LINQ Join
- Speed up LINQ inserts