C# Bestpractice: Writing a method that returns a value in depdency of the method parameter that is a part of the class itself
<p>At first sorry for my really bad title! If you have a better title just change it or make a comment =)</p>

<p>I have this class:</p>

<pre><code>public class Config
{
    public Provider1 Provider1 { get; set; }
    public Provider2 Provider2 { get; set; }
    public Provider3 Provider3 { get; set; }
    public Provider4 Provider4  { get; set; }
    public Provider5 Provider5 { get; set; }

    public int GetNumber(string provider)
    {
        ...
    }
}
</code></pre>

<p>Each provider has a Number property:</p>

<pre><code>public interface IProvider
{
    int Number{ get; set; }
}
</code></pre>

<p>In dependency of the provider I want to return the Number of the provider.</p>

<p>How would you do that?</p>

<p>I do not want to use a big switch block. </p>
