title: C# re-use LINQ expression for different properties with same type
body: <p>I have a class with several <code>int</code> properties: </p>
  
  <pre><code>class Foo
  {
      string bar {get; set;}
      int a {get; set;}
      int b {get; set;}    
      int c {get; set;}
  }
  </code></pre>
  
  <p>I have a LINQ expression I wish to use on a <code>List&lt;Foo&gt;</code>. I want to be able to use this expression to filter/select from the list by looking at any of the three properties. For example, if I were filtering by <code>a</code>: </p>
  
  <pre><code>return listOfFoo.Where(f =&gt; f.a &gt;= 0).OrderBy(f =&gt; f.a).Take(5).Select(f =&gt; f.bar);
  </code></pre>
  
  <p>However, I want to be able to do that with any of <code>f.a</code>, <code>f.b</code>, or <code>f.c</code>. Rather than re-type the LINQ expression 3 times, I'd like to have some method which would take an argument to specify which of a, b, or c I want to filter on, and then return that result. </p>
  
  <p>Is there any way to do this in C#? Nothing immediately comes to mind, but it feels like something that should be possible. </p>