title: Creating a Dynamic Linq filter over List<T>
body: <p>Ok, I asked this question before, but deleted it as the way I went about describing my problem was wrong.</p>
  
  <p>Firstly, let me state that Im creating a .NET3.5 Winforms app using C# and <a href="http://www.plinqo.com" rel="nofollow noreferrer">Plinqo</a> (Professional Linq to Objects) as my ORM. Here's my situation:  I have a DataGridview that is populated from a <code>SortableBindingList&lt;T&gt;</code> - in my case, formed from a <code>List&lt;Task&gt;</code> which is simply represented as follows:</p>
  
  <pre><code>public class Task {
      public long TaskID { get; set; }
      public string TaskDescription { get; set; }
      public enumPriority TaskPriority { get; set; }
      public DateTime DueDate { get; set; }
      public double PercentageComplete { get; set; }
  }  
  </code></pre>
  
  <p><br>
  Now, I want to provide a Dialog to my user to allow him/her to Filter this list. I envision passing in a list of property names and associated DataType into the Dialog that I can use to populate a ComboBox. So the user will choose which property they want to query from the comboBox and based on the selection the appropriate comparers and UI control will be made available for the user to enter in thier criteria.  Lastly, it will contain an AND/OR togglebutton at the end which the user can use to add additional criterion. Each criterion will be an object of type <code>FilterItem</code> as shown below:</p>
  
  <pre><code>public class FilterItem {
      public string MappedPropertyName { get; set; }
      public enumComparer Comparer { get; set; }
      public object FilterValue { get; set; }
      public enumOpertor Operator { get; set; }
  }
  </code></pre>
  
  <p><br>
  After the user constructs his/her query, I intend to pass this as a <code>List&lt;FilterItem&gt;</code> back to my calling form, which can then iterate thru the list and allow me to filter the original <code>List&lt;Task&gt;</code>.  </p>
  
  <p>This is all fine, and something that I can put together with ease.  But I want to make sure that the ACTUAL filter mechanism I go with is as strongly-typed as possible, and not using bulit up strings like in the Dynamic Query Library. (I used to do something similar previously with ADO.NET, DataViews and dynamically constructing a RowFilter string)</p>
  
  <p>I've read up on Joseph Albahari's <a href="http://www.albahari.com/nutshell/predicatebuilder.aspx" rel="nofollow noreferrer">PredicatBuilder</a> and <a href="http://tomasp.net/blog/dynamic-linq-queries.aspx" rel="nofollow noreferrer">an article on tomasp.net</a>, but I seem heavily confused with it and expression trees in general.</p>
  
  <p>I sincerely seek your assistance in helping me better understand these concepts, and how to go about using it up so that my intended architecture can work with it.</p>
  
  <p>Much appreciation!</p>