title: how to allow the user to choose how to sort his list using a variable?
body: <p>the information that the user enters can be sorted in many ways ascending and descending and i'm trying to make the user choose how he want to see the data:</p>
  
  <p>so is there any way to set a variable that the user enter and sort the data without repeating the code multiple time depending on the input like:</p>
  
  <pre><code>var empName = el.Select(i =&gt; new { i.ID, i.FullName });
      if(emsort.Text="text1")
      empName.OrderBy(i.text1);
  else if...
  </code></pre>
  
  <p>by doing something shorter like:</p>
  
  <pre><code> string sort=emsort.Text ;
  empName.OrderBy(sort);
  </code></pre>