Hi,
having code placed below, I cannot clue out, how to convert query in FilterData() to a dynamic query. Any ideas how to do it? Thanks in advance for any hint.
Martin
public class Item
{
public DateTime SampleDate;
public List<String> Columns = new List<String>(); //this stores all columns
}
public class ItemList : List<Item>
{
public void GetDataFromFile()
{
//hier I read data line by line from a file, and split each line to get column
foreach(var row in "rows read from a file")
{
Item myRow = new Item();
myRow.SampleDate = "data column read from a file";
foreach(var col in "columns read from a file")
{
myRow.Columns.Add("col");
}
this.Add(myRow)
}
}
public void FilterData(string criteria)
{
var query = this.Where(x => ((Item)x).Columns[3] == criteria).ToList();
}
}