Generic order method by specific property
<p>I am quite new in generic programming and have a question:</p>

<p>I am trying to order a list by specific properties which should be defined as parameter.
Please look at the code for better understanding what I want:</p>

<pre><code>public static IEnumerable&lt;T&gt; SortEmployeesFor&lt;T&gt;(
    IEnumerable&lt;T&gt; list,
    property1,
    property2, 
    OrderOptions options)
{
    switch (options)
    {
        case OrderOptions.1:
            return list.OrderBy(x =&gt; property1).ThenBy(x =&gt; property2);

        case OrderOptions.2:
            return list.OrderBy(x =&gt; property2).ThenBy(x =&gt; x.property1);

        ...
    }

    return list;
}
</code></pre>

<p>Is there any option to perform this?</p>

<hr>

<p>P.S. It's my first post, if I did something wrong, please understand and let me know.</p>
