score:0
Accepted answer
Seems to work fine for me:
public class SomeType
{
public string var1;
public string var2;
}
class Program
{
static void Main(string[] args)
{
var myList = new List<SomeType>();
myList.Add(new SomeType() { var1 = "abc", var2 = "abc" });
myList.Add(new SomeType() { var1 = "def", var2 = "def" });
foreach (var item in myList.AsQueryable().Where("var1=\"abc\""))
Console.WriteLine("item.var1 = " + item.var1);
}
}
Source: stackoverflow.com
Related Articles
- LINQ Dynamic Query Library setup
- Using LINQ Dynamic Query Library with Dictionary<string, object> and .AsQueryable()
- How to build a nested query with the dynamic LINQ library
- How to dynamic add filters to a LINQ query against an Odata Source in C#
- EF4 CTP5 - LINQ Dynamic Query Library throws InvalidCastException
- Need help with a LINQ Query using the Dynamic LINQ Library
- LINQ query to perform a projection, skipping or wrapping exceptions where source throws on IEnumerable.GetNext()
- Query data using "Contains" keyword in Dynamic Linq in C#
- 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
- linq query with dynamic predicates in where clause joined by OR
- How to write this Linq SQL as a Dynamic Query (using strings)?
- How to cast a Linq Dynamic Query result as a custom class?
- How can I create a dynamic LINQ query in C# with possible multiple group by clauses?
- LINQ Source Code Available
- Dynamic linq query not working
- Dynamic Linq query - how do I build the select clause?
- linq - how do you do a query for items in one query source that are not in another one?
- Linq to object dynamic query is it possible?
- How can I write the following code more elegantly using LINQ query syntax?
- Dynamic LINQ date query performance
- C# Linq query help removing foreach loops creating cleaner code
- Use a linq query as microsoft local report Data Source (WinForms)
- C# How to use LINQ to grab all cell data under a particular column header name
- Equivalent of SQL ISNULL in LINQ?
- Binding an ObservableCollection of two related entities to one DataGrid
- How to get image from database
- How to Group and Order in a LINQ Query
- LinQ does not recognize the method 'int32 toint32'
- Determine whether two or more objects in a list are equal according to some property
- How can i compare table colums in a fast way, 2 tables
- How do I select with linq an attribute from an xml tag on the same level?
- Entity Framework object LINQ query Timeout issues
- Is there an easy way to append lambdas and reuse the lambda name in order to create my Linq where condition?
- Determining a SQL Server Identity Column Name in .NET
- Find objects in list that match elements in array
- Split results from DB into "chunks" of 10
- How to extend predicate in lambda expression parameter
- Convert Linq expression to use CompiledQuery
- LINQ Select distinct on different variables
- Writing a predicate for Linq (2Sqlite)
- ASP.NET MVC5 Entity Framework 6 get bool = true and bool = false LINQ
- How do I create a query to arrange my data in a certain format?