title: Class design for filter expressions
body: <p>I have a couple of C# business class as follows:</p>
  
  <pre><code>    public class Employee
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string DepartmentCode { get; set; }
      public string HireDate { get; set; }
      public DateTime DateOfBirth { get; set; }
      public DateTime Gender { get; set; }
  }
  
  public class EmployeeManagement
  {
      public List&lt;Employee&gt; GetEmployees(FilterExpression criteria)
      {
          throw new System.NotImplementedException();
      }
  }
  </code></pre>
  
  <p>The goal is to get the list of employees by passing various filter conditions e.g. all employees belonging to particular department, or hired after a particular date or all female employees or a combination of criterias (involving AND or OR conditions). I don't wish to implement many of the overloaded methods for each of the filter criteria since the end users are defining the filter criteria and i can not assume all possible cases.</p>
  
  <p>Can you please help in designing the "FilterExpression" class that i can pass to GetEmployees method? Any other alternate approach suggestion would be welcome.</p>
  
  <p>Thanks.</p>
  
  <p>More details: The employee data is stored in a DB table. I don't want to bring in all the employees in <code>List&lt;Employee&gt;</code> and then filter the data. My goal is to generate the SQL "where clause" from the filter expression so that from the database itself, I get the filtered Employee dataset. I am struggling with the class design of the FilterExpression class as asked above.</p>